Help - Search - Members - Calendar
Full Version: suPHP How-To Revised
The Planet Forums > Control Panels > Plesk > Plesk HOWTOs
agruetz
After some more production testing this is a revised copy of my orginal suPHP how-to. suPHP benifits you because it makes php scripts run like perl/cgi ones. This is better for security and better for php programmers who after to write to files.

Name: suPHP & Plesk 7.5.1 How-To

Written By: Anthony Gruetzmacher

Written On: 09/01/2005

Website: www.helixdevelopment.com

# Get suPHP #

1) wget http://www.suphp.org/download/suphp-0.5.2.tar.gz

# Untar suPHP #

2) tar-zxvf suphp-0.5.2.tar.gz

# Move to the suPHP directory #

3) cd suphp-0.5.2

# Configure suPHP to work with psa 7.5.1 #

4) use the following config like --with-prefix/usr --with-apxs=/usr/sbin/apxs --with-min-uid=0 --with-min-gid=0 --with-

apache-usr=apache --with-php=/usr/bin/php --with-logfile=/var/log/httpd/suphp_log --with-setid-mode=owner

# Compile suPHP #

5) make

# Install suPHP #

6) make install

# Turn on suPHP #

7) vi /etc/httpd/conf/httpd.conf
# add the following lines to the module load section #

LoadModule mod_suphp modules/mod_suphp
suPHP_Engine On
# Delete where suPHP automaticly adds suPHP to the httpd.conf #

icon_cool.gif find LoadModule mod_suphp /usr/lib/httpd/modules/mod_suphp.so and delete it

# Save the httpd.conf and restart to see the changes #

9) save file

# Move to another apache config directory #

10) cd /etc/httpd/conf.d/

# Add a file of suPHP excluded sites #

11) vi suphp_exclude.conf

# This must here for webmail to function properly #

66.98.220.122:80
66.98.220.126:80
66.98.220.85:80
>
DocumentRoot /home/httpd/vhosts/webmail
ServerName webmail
ServerAlias webmail.*
UseCanonicalName Off
suPHP_Engine off


php_admin_flag engine on
php_admin_flag magic_quotes_gpc off
php_admin_flag safe_mode off
php_admin_value open_basedir "/home/httpd/vhosts/webmail:/etc/psa:/tmp"
php_admin_value include_path

"/home/httpd/vhosts/webmail/horde/lib:/home/httpd/vhosts/webmail/horde/pear:."




# This is only needed if you have sitebuilder installed #


ServerAdmin sb_team@sw-soft.com
DocumentRoot /usr/local/sitebuilder
ServerName sitebuilder.*
ServerAlias sitebuilder.*
ErrorLog logs/sitebuilder-error_log
CustomLog logs/sitebuilder-access_log common
DirectoryIndex /wizard/index.php
AddDefaultCharset UTF-8
suPHP_Engine off


# Save file #

12 ) Save file and restart apache /sbin/service httpd restart

# Enjoy a more secure server #

12) enjoy all php files should now run under the owner of the script and be logged to suphp_log in /var/log/httpd
JLChafardet
shame to say that there is no way for me to get this to work.... even after lots of retryes.

Today i had a server restoration, and neither with a brand new restored server su_PHP wants to work on my box.

regards,
agruetz
Are you just going to say it does not work? Or give an error message?
JLChafardet
y0 agruetz, i managed to install it, but for some wierd reason it worked good exept for webmail, i added the suphp_exclude.conf file and configured as you say on the howto.

there is no way for me to stop the box from trying to send me index.php on webmail.

but it worked great for the rest for about 2 days.

regards,
agruetz
Without errors I can help you. Yes it does not agree with web mail because the way plesk does it. Thats why I tell you how to exclude it from the suphp list.
YooHosting
I have done all you says in the how to but I have this error when I restart httpd :

Jun 11 06:25:01 ns1 httpd: Syntax error on line 200 of /etc/httpd/conf/httpd.conf:
Jun 11 06:25:01 ns1 httpd: Cannot load /usr/local/psa/admin/libexec/mod_suphp.so into server: /usr/local/psa/admin/libexec/mod_suphp.so: undefined symbol: ap_chdir_file
agruetz
May I see your httpd.conf file. Also the other problem is this is an old post with an error in the suPHP config line. try compiling it with this

--with-prefix=/usr --with-apxs=/usr/sbin/apxs --with-min-uid=0 --with-min-gid=0 --with-apache-user=apache --with-php=/usr/bin/php --with-logfile=/var/log/httpd/suphp_log --with-setid-mode=owner

also http://devzone.helixdevelopment.com has the latest how-to updates on it.
JLChafardet
to be honest i give up. i cant manage to make it works, there are no errors in fact, now i redid the how-to, exactly as it is in your site, and su-php just dont work. so, sorry but how do you want me to put any error when there are none?

i'll see how does it behaves in the next hours, (as it is neither loging nothing on suphp_log) and if i found any anomaly i'll post it here.

regards,
JLChafardet
QUOTE (YooHosting)
I have done all you says in the how to but I have this error when I restart httpd :  

Jun 11 06:25:01 ns1 httpd: Syntax error on line 200 of /etc/httpd/conf/httpd.conf:
Jun 11 06:25:01 ns1 httpd: Cannot load /usr/local/psa/admin/libexec/mod_suphp.so into server: /usr/local/psa/admin/libexec/mod_suphp.so: undefined symbol: ap_chdir_file


which apxs did you used?

the apxd you need is the one that is installed with httpd-devel not the one for the apache on plesk.

up2date --nox --install httpd-devel

then use the configure with /usr/sbin/apxs

regards,
aussie
Anyone tired this with Cpanel yet? How to? Instructions? Resources? any info on it?
agruetz
There is no need on cpanel look under the apache rebuild area and you will find phpsuexec (that is what suphp used to be) it will give the same effect.
YooHosting
This command line doesnt work for me :

up2date --nox --install httpd-devel


The following packages you requested were not found:
httpd-devel
YooHosting
my httpd.conf :

http://yoohosting.com/tmp/httpd.conf

But JLChafardet is right I thing concerning my apxd use.
I dont have it on my httpd and the up2date doesnt work icon_sad.gif
JLChafardet
you should try then yum.

What distro is your server runing on?

RHEL?

keep in mind, that apxs for plesk apache is for apache 1.x not 2.x

try up2date -i httpd-devel
YooHosting
I use FC2 and Plesk 7.5.3

and phpinfo as : http://yoohosting.com/sinfo/phpinfo.php
YooHosting
Well I succed to setup all, and It was ok for my website but the webmail didn't worked and I saw a BIG lag just 5 minutes after it was activated.
I removed it. icon_sad.gif
EvolutionCrazy
i've enabled it 12hours ago...

till now everything is working fine (i've modified httpd.include instead of creating a new exclusion that can couse some problems (like horde opened when you try to access by ip...) finally i've my uploaded files owned by the right user, so i can delete them via ftp and i do not need to chmod 777 all te dirs where i want to upload to icon_biggrin.gif

PS: yesterday a new version has been released: 0.6.0 icon_wink.gif
demirkafa
i install su php
but some php file is giving error and dont work
i look up log file and see like this

[Tue Aug 02 02:13:09 2005] [error] Script (/home/httpd/vhosts/zohbetci.com/httpdocs/index.php) is writeable by others

what is it mean. or how could i solve this problem

Thanks
JLChafardet
QUOTE (demirkafa)
i install su php
but some php file is giving error and dont work
i look up log file and see like this

[Tue Aug 02 02:13:09 2005] [error] Script (/home/httpd/vhosts/zohbetci.com/httpdocs/index.php) is writeable by others

what is it mean. or how could i solve this problem

Thanks


this means that your php file is with permissions to be writen by anyone aka chmod 777, you should try chmoding it to 755, chmod 755 file.php where file is index.php as i see on your error.
demirkafa
QUOTE (JLChafardet)
this means that your php file is with permissions to be writen by anyone aka chmod 777, you should try chmoding it to 755, chmod 755 file.php where file is index.php as i see on your error.


Thanks for your answer master

i understand but i am not able to force user to do that

how could disable this features.

icon_smile.gif
wouter
Does anyone knows if this also work whit plesk 8.* ? I know the location of webmail has changed.

Greets Wouter
EvolutionCrazy
abandoned it long time ago..

but now i see that ART have mod_suphp rpm in the testing channel.... uhm... rolleyes.gif

http://3es.atomicrocketturtle.com/atomic-t...g/art/4ES/RPMS/

who knows... icon_smile.gif
JLChafardet
Man have you tested this art suphp?

QUOTE (EvolutionCrazy)
abandoned it long time ago..

but now i see that ART have mod_suphp rpm in the testing channel.... uhm... rolleyes.gif  

http://3es.atomicrocketturtle.com/atomic-t...g/art/4ES/RPMS/

who knows... icon_smile.gif
EvolutionCrazy
no, sorry icon_biggrin.gif
agruetz
Hey everyone. Hows it going. Sorry I have not updated this in sometime. I will be trying to get a new how-to and possibly a suphp rpm out for plesk 8. I have been away to iraq for the last 7 months so I have not really been able to keep up. But I am back now so expect to start seeing how-to's like this return and maybe even some rpm's. I have build a aide rpm with a base config you can get it at my site in the forums area. I will be adding some updates in the form of downloadable config files for plesk/cpanel as soon as I get a chance. Anyway it is nice to be back see you guys later.
lvalics
You can get from ART
yum install mod_suphp

After that you can follow the tutorial from
http://www.grafxsoftware.com/faq.php/HOW-T...ted-Server/1/4/

Hope this help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.