Install mod_suphp

No Comments

suphp configuration:

download a copy of an rpm from http://dag.wieers.com/rpm/packages/mod_suphp/

after the rpm is installed install

Plesk

1) make following changes to /etc/suphp.conf:

; docroot=/
[handlers]
;Handler for php-scripts
;x-httpd-php=php:/usr/bin/php
suphp-script=php:/usr/bin/php-cgi

;Handler for CGI-scripts
x-suphp-cgi=execute:!self

2) make following changes to /etc/httpd/conf.d/suphp.conf (these are the most important changes, as they’ll prevent other vhosts from using suPHP or just breaking randomly)

suPHP_Engine off
#AddHandler x-httpd-php .php
#AddHandler x-httpd-php .php .php4 .php3 .phtml

3) create /var/www/vhosts/<domain>/conf/vhost.conf as follows:

<Directory /var/www/vhosts/<domain/httpdocs>
suPHP_Engine on
suPHP_UserGroup <user> <group>
suPHP_ConfigPath /var/www/vhosts/<domain>/etc
AddHandler suphp-script .php
</Directory>

4) create /var/www/vhosts/<domain>/etc and copy /etc/php.ini to it

5) create var/www/vhosts/<domain>/tmp and update session save path in php.ini

6) run /usr/local/psa/admin/sbin/websrvmng -av, and restart apache

Not plesk:
remove the /etc/httpd/conf.d/suphp.conf file and did everything in the httpd.conf folder

These are the lines that are needed outside the vhosts

LoadModule suphp_module modules/mod_suphp.so
suPHP_Engine on

These are the lines needed inside of the vhosts

<Directory /var/www/html/<domain>/httpdocs>
       php_admin_flag engine off
       suPHP_Engine on
       suPHP_UserGroup user user
       suPHP_ConfigPath /var/www/html/mobile/etc/php.ini
       SuPHP_AddHandler suphp-script
       AddHandler suphp-script .php
   </Directory>