sparek-3

Well-Known Member
Aug 10, 2002
1,929
180
343
cPanel Access Level
Root Administrator
In order for suPHP to work on a CPanel server you need to apply a lot of patches. You also have to edit the VirtualHost template and insure that the template does not get overwritten.

I really think suPHP is a better offering than the phpsuexec offering that CPanel currently offers. I wish they would investigate incorporating suPHP instead of phpsuexec into the CPanel application. But it would require some work to get it working. I have gotten it to work on a couple of our CPanel servers, but unfortunately, I just do not have a how to guide on how to do it. I know there were a lot of patches applied and some of these patches conflicted with other patches, meaning you had to manually edit the suPHP code.

If I ever get enough free time, I will see if I can do a how to guide.
 

eger

Well-Known Member
Feb 28, 2003
128
0
166
I am testing out the latest edge and easyapache right now. SO far it LOOKS really nice. I'll post a reply of how well it works. Trying latest php 5 with apache 2.0 (since 2.2 doesn't support suPHP...yet).
 

sparek-3

Well-Known Member
Aug 10, 2002
1,929
180
343
cPanel Access Level
Root Administrator
chirpy said:
They have. suPHP is available in the new easyapache2 available in EDGE at the moment ;)
Really? Thats great. But is easyapache2 for Apache 2 only? Or what is the significance of the 2? I'd be interested in seeing how they integrated it. I don't currently have a test server where I can install Edge, but if I can get a server where I can play around, I'll have to try Edge and see how suPHP works.
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,462
25
473
Go on, have a guess
easyapache2 is simply the latest version of easyapache which will build apache v1.37 v2.0* and v2.2*. suPHP is an option for apache v2.0* at present (among a very long list of new options).
 

eger

Well-Known Member
Feb 28, 2003
128
0
166
sparek-3 said:
Really? Thats great. But is easyapache2 for Apache 2 only? Or what is the significance of the 2? I'd be interested in seeing how they integrated it. I don't currently have a test server where I can install Edge, but if I can get a server where I can play around, I'll have to try Edge and see how suPHP works.
The new easy apache is for both 1 and 2 and 2.2. It is a complete rewrite and I must say it is very nice and clean (surprised since most cPanel scripts don't have very clean output).

Was going well for my test. But I guess it was too good to be true. Here was the error I was returned right as it was finished:

Code:
**** Done building apache 2, starting post run tasks **

Cleaning up build directories...
Done
Resolving possible problems caused by apache 2.0's apxs adding apache 1 style entries to an apache 2 config
httpd.conf SRC: 2 TRG: 1
Done!
Done!
Error: postcheck() returned a failed status
        Restoring previously working apache
Done!
There are some new options to put everything into a .bad dir if postcheck fails so I will try that next run and see if I can spot the problem. I am also testing on a machine that I was testing betas on with Dan and may have something very askew...
 

eger

Well-Known Member
Feb 28, 2003
128
0
166
Did a second round with Verbose building and got the error causing postcheck to fail.

Code:
Cleaning up build directories...
Done
Resolving possible problems caused by apache 2.0's apxs adding apache 1 style entries to an apache 2 config
httpd.conf SRC: 2 TRG: 2
Done!
Syntax error on line 310 of /usr/local/apache/conf/httpd.conf:
Port was replaced with Listen in Apache 2.0
Error: postcheck() returned a failed status
        Restoring previously working apache
Copying postcheck() failed build to .bad...
Done!
Trying now with a removed httpd.conf to see if it will rebuild it for apache 2. Strange it did not autofix this error making it fail when trying to go from a 2.2 config file to 2.0.

Will try removing the httpd.conf and then just removing line 310 next and see what happens.

EDIT: Just also noticed that the httpd.conf SRC says 2 and the TRG says 2 where the source should have been 2_2. Possibly the error in postcheck...
EDIT2: Couldn't get it to work with missing httpd.conf, or edited httpd.conf. Fails then on something about ssl.conf. Calling it a day, if interested I will try to update this thread tomorrow when I try some more =)
 
Last edited:

eger

Well-Known Member
Feb 28, 2003
128
0
166
Well I have given up for now. I have probably run easyapache about 20 times now and everytime it is something else wrong... ssl.conf, httpd.conf, mod_auth_passthrough, mod_ssl, log folders not being found, can't bind to ports even when 80 and 443 are free, etc..

Also tried going back to apache 1.3 and 2.2 with no luck. Definitely not working at least without some manual configuration hacking.
 

eger

Well-Known Member
Feb 28, 2003
128
0
166
timdorr said:
That's just regular CGI with some bells and whistles? What's the point then?

Go with FastCGI and you'll have PHP5 running at proper speed in comparison to running it as a slow, wasteful CGI: http://timdorr.com/archives/2006/02/php4_and_php4_s.php
That may be the case, I haven't checked. But the point I think was more that it was a solution created and supported by cPanel in easyapache so no 'external hacking' should be required. Though there is always going to be some hacking to get the new things working.
 

dave9000

Well-Known Member
Apr 7, 2003
891
1
168
arkansas
cPanel Access Level
Root Administrator
Here is what I had to do to get suPHP working with apache 2.0.x and php 4.4.4

edit the httpd.conf and add this line to the LoadModules section

LoadModule suphp_module modules/mod_suphp.so

and then comment out this line in the below section

<IfModule mod_suphp.c>
suPHP_Engine On
suPHP_ConfigPath /opt/suphp_php_bin
------> #suPHP_AddHandler x-httpd-php

<Directory /home*/*/public_html>
suPHP_AddHandler x-httpd-php
</Directory>
AddHandler x-httpd-php .php .php3 .php4 .phtml
AddType application/x-httpd-php .php .phtml .php3 .php4
</IfModule>
<IfModule !mod_suphp.c>
AddHandler x-httpd-php .php .php3 .php4 .phtml
AddType application/x-httpd-php .php .phtml .php3 .php4
</IfModule>

restart apache and you should have suPHP enabled apache2

Here is a link to a phpinfo page on the test server

http://test.isitetech.com/php.php
 

eger

Well-Known Member
Feb 28, 2003
128
0
166
Dave,

I noticed that too. Looks like it doesn't belong there and the one below it is the correct one. Here is what I had to do to get 2.0 with suPHP up and running.

First, leave when running easyapache you will need to leave build as is and manually resolve errors.

Then I had to:

1. Change the 'Port 80' line to 'Listen 80' in httpd.conf
2. Remove 'ClearModuleList' from httpd.conf
3. Change 'SSLLog' to 'ErrorLog' in httpd.conf
4. Change 'SSLLogLevel' to 'LogLevel' in httpd.conf
5. Comment or remove the first suPHP_AdddHandler line (as stated by dave's post above)

Then it was up and running for me. Guess once they fix those kinks out it should be good. I would think these are things the postcheck is supposed to be doing since it even detects which config version it is coming from and moving to.

Hope this might help someone.

EDIT: removed last step. not sure how to get the main hostname working. defaults to the first virtualhost on the IP for me. Not a big deal.
 
Last edited:

sparek-3

Well-Known Member
Aug 10, 2002
1,929
180
343
cPanel Access Level
Root Administrator
eger said:
EDIT: removed last step. not sure how to get the main hostname working. defaults to the first virtualhost on the IP for me. Not a big deal.
This is one place where using various suPHP patches to get this to work. The suphp.conf file (in /etc?) defines the docroot, for my custom servers this is defined as /home. But the hostname VirtualHost entry refers to /usr/local/apache/htdocs as the hostname directory, which is not within /home.

There are a couple of patches that you apply to suPHP that allows you to overwrite this setting within the VirtualHost setting and another that does not check this docroot requirement. You have to apply these patches to suPHP before it is compiled. Then within the hostname's VirtualHost section you have to add:

suPHP_GlobalDocRoot /usr/local/apache/htdocs
suPHP_DontCheckVHostDocRoot Yes


Unforunately, I'm not sure where these patches are. I know I found them on the suPHP mailing list. And again, I'm not sure how this works with CPanel's rendition of suPHP. Also, I'm only using Apache 1.3, I have never used Apache 2 (not really looking forward to its adoption, but I guess its coming sooner or later) so I don't know how much of this applies to my suPHP customizations. I just know that there was a lot of customizations applied for me to get this to work with Apache 1.3, but I really like some of the added capabilities that suPHP allows for.
 

eger

Well-Known Member
Feb 28, 2003
128
0
166
Hopefully cPanel devs take notes on threads and they will work around these bugs. Maybe I should give Dan at cPanel a heads up about these issues so he can resolve them before merging easyapache2 into current or release...
 

dave9000

Well-Known Member
Apr 7, 2003
891
1
168
arkansas
cPanel Access Level
Root Administrator
eger said:
Hopefully cPanel devs take notes on threads and they will work around these bugs. Maybe I should give Dan at cPanel a heads up about these issues so he can resolve them before merging easyapache2 into current or release...
What I have been doing is when I verify a issue and fix I drop Dan a note with the specifics of the issue and the fix so he can look it over for the next release of the easyapache