serversolutions

Registered
Jan 31, 2007
2
0
151
Hi,

I want to enable suphp and fast-cgi for my cpanel server, can I do it ?
Also, is this a good idea to have suphp and fast-cgi to secure php on our server.

Best Regards,
Rik
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
Hi,

I want to enable suphp and fast-cgi for my cpanel server, can I do it ?
Also, is this a good idea to have suphp and fast-cgi to secure php on our server.

Best Regards,
Rik
Nope ... Doesn't Work! I've tried it on many servers before giving up!

For some reason, SuPHP only likes running with PHP compiled as a regular CGI
but it really is not necessary to run fast-cgi as suPHP is extremely efficient and
surprisingly gives faster performance than both phpSuExec and module based PHP.

As for how to enable it ....

You currently would need to upgrade to Apache 2.0 (recommended) or 2.2
if you want Cpanel to actually support SuPHP

For now, that means you will have to go to EDGE in order to be able to do that.

/scripts/easyapache is the script you would need to make that upgrade but
you should be warned that script is riddled with problems and unless you know
precisely what you are doing to get around it's shortcomings, you may find
yourself with a non-working server that takes hours to fix for most average
people instead of an upgraded server.

With that said, SuPHP works AWESOME on Apache 2 with Cpanel 11.1 and I recommend
it to everyone out there who is willing to stomach the upgrade process.
 

intel352

Well-Known Member
Nov 25, 2003
55
0
156
NC, USA
Actually, the previous post was incorrect. It's possible to get PHP 4, PHP 5, FastCGI, and SuPHP all installed, with Apache 1.3.x & Cpanel, and still function happily :)

I'm trying to find the how-to links, I'll post back shortly
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
Actually, the previous post was incorrect. It's possible to get PHP 4, PHP 5, FastCGI, and SuPHP all installed, with Apache 1.3.x & Cpanel, and still function happily :)

I'm trying to find the how-to links, I'll post back shortly
Not without causing very serious stability problems ...

I can install it no problem. Whether it works well is another story entirely.

The problem lies in technical incompatibilities between FastCGI and SuPHP
and will drastically degrade performance of your scripts and cause a number
of false error issues when both FastCGI and SuPHP are installed.

On other subjects, if you install SuPHP on Apache 1.3.x, it won't be supported
by Cpanel which doesn't mean it won't work but rather that you are in extreme
danger of Cpanel later overwriting your configuration and messing you up.
You need to be on Apache 2 or above for Cpanel to formally recognize the
extra SuPHP commands and configuration and not overwrite your configuration.
 

intel352

Well-Known Member
Nov 25, 2003
55
0
156
NC, USA
CPanel 11, Apache 1.3x, SuPHP, FastCGI, PHP 4, PHP 5, works great for me. I've had this setup (except Cpanel 10 previously) for 6 months now, no issues.
 

orty

Well-Known Member
Jun 29, 2004
109
0
166
Bend, Oregon
cPanel Access Level
Root Administrator
CPanel 11, Apache 1.3x, SuPHP, FastCGI, PHP 4, PHP 5, works great for me. I've had this setup (except Cpanel 10 previously) for 6 months now, no issues.
And I'll repeat somebody else's suggestions: How-to links or guidance would be really helpful. I'm primarily interested in FastCGI myself, especially in an implementation that won't get hosed on cPanel updates.
 

intel352

Well-Known Member
Nov 25, 2003
55
0
156
NC, USA
I'm working on putting together a good how-to, along with a pre-patched version of SuPHP (since the patches don't work with the newest version of SuPHP, there's no point in describing what the patches were for). I've built a script that will compile PHP 4 & 5 (tho it could use some improvement) with Suhosin, and I've got a postwwwacct script for cpanel that modifies httpd.conf for suphp for new accts. [EDIT] nevermind about the postwwwacct script, CPanel actually does the change on it's own, apparently it detects suphp properly in CPanel 11[/EDIT]

i'll have it done soon
 
Last edited:

mblendinger

Member
Apr 27, 2004
5
0
151
Hello dears, I have the following problem, maybe you have a solutions for me :)

My problem is than the .fcgi scripts are runned as "nobody", not with the username of the account like .cgi and .php

Do you know what the problem is ?

thank you!!!
 

MACscr

Well-Known Member
Sep 30, 2003
198
5
168
cPanel Access Level
Root Administrator
How can i get suPHP and FastCGI to work at the same time with the same php version with EA3? Is this even possible? Maybe i dont even know what im doing, but i swear that i read that running FGI and suPHP was one of the best conbinations for security, but still being fast.
 

intel352

Well-Known Member
Nov 25, 2003
55
0
156
NC, USA
macscr, latest easyapache (edge) supports suphp, fastcgi, and more. in WHM, just select the options that you want to have compiled. (select suphp, then fastcgi, fastcgi redirect, and might also need the regular cgi option as well)
 

MACscr

Well-Known Member
Sep 30, 2003
198
5
168
cPanel Access Level
Root Administrator
macscr, latest easyapache (edge) supports suphp, fastcgi, and more. in WHM, just select the options that you want to have compiled. (select suphp, then fastcgi, fastcgi redirect, and might also need the regular cgi option as well)
Right, but when doing the configuration at the end after the build, you select the handler and fcgi and suphp are two different options. You cant select both.
 

jdlightsey

Perl Developer III
Staff member
Mar 6, 2007
126
2
243
Houston Texas
cPanel Access Level
Root Administrator
FastCGI is a communication protocol like CGI. When you compile PHP with FastCGI support that gives it the capability to speak FastCGI in addition to regular CGI. PHP4 does this rather poorly and sometimes tries to communicate using the FastCGI protocol when the other side of the connection is trying to speak CGI. PHP5 seems to be a little better at telling the two apart.

Mod_suphp talks to the PHP binary in CGI. If you compile PHP with FastCGI support and run it through mod_suphp, PHP should be talking to mod_suphp in CGI. If it gets confused for one reason or another and tries to communicate using the FastCGI protocol, mod_suphp isn't going to understand it and you'll end up with some interesting and uninformative error messages.

Mod_fcgid does communicate using the FastCGI protocol and it also handles starting and stopping PHP processes running as FastCGI servers. There are lots of caveats involved, and the fastcgi setup cPanel creates is very basic, so this is really not a recommended way of running PHP if you're not sure of how it works. It would be better to run PHP as a DSO for best performance or through mod_suphp for better security.