Hello,
after having lot of troubles with joomla, wordpress and others softwares I decided finaly install suphp on my servers. I spend few days for searching and investigating for full automated solution. And at last ... system is working. Here all install manual, how i did. Maybe somewhere I wrong, but this solution is working for me.
First of all, download and install atomic script:
# wget -q -O – http://www.atomicorp.com/installers/atomic | sh
after script is instaled, install mod_suphp
# yum install mod_suphp
Next step is enable suPhp in apache, create suphp.conf file in
# vi /etc/httpd/conf.d/suphp.conf
and insert the following:
LoadModule suphp_module modules/mod_suphp.so
php_admin_value engine off
suPHP_Engine On
AddHandler x-httpd-php .php .php3 .php4 .php5
suPHP_AddHandler x-httpd-php
After that we need to create config for suphp in /etc suphp.conf
[global]
;Path to logfile
logfile=/var/log/suphp.log
;Loglevel
loglevel=warn
;User Apache is running as
webserver_user=apache
;Path all scripts have to be in
docroot=/var/www/vhosts:${ HOME}/httpdocs
;Path to chroot() to before executing script
;chroot=/mychroot
; Security options
allow_file_group_writeable=true
allow_file_others_writeable=false
allow_directory_group_writeable=true
allow_directory_others_writeable=false
;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=false
;Send minor error messages to browser
errors_to_browser=true
;PATH environment variable
env_path=/bin:/usr/bin
;Umask to set, specify in octal notation
umask=0022
; Minimum UID
min_uid=30
; Minimum GID
min_gid=30
; Use correct permissions for mod_userdir sites
;handle_userdir=true
[handlers]
;Handler for php-scripts
php5-script=php:/usr/bin/php-cgi
;Handler for CGI-scripts
x-suphp-cgi=execute:!self
Now we can restart apache:
/etc/inid.d/httpd restart
Install of suphp is done.
Now it's time to configure plesk add suphp in hosts:
cd /usr/local/psa/bin
touch suphp_domain.sh
chown root:root
chmod 755
vi suphp_domain.sh
#!/bin/bash
sleep 30
echo '# PHP version detected 5' >> /var/www/vhosts/$1/conf/vhost.conf
echo '<IfModule mod_suphp.c>' >> /var/www/vhosts/$1/conf/vhost.conf
echo "<Directory \"/var/www/vhosts/$1/httpdocs/\">" >> /var/www/vhosts/$1/conf/vhost.conf
echo 'php_admin_flag engine on' >> /var/www/vhosts/$1/conf/vhost.conf
echo 'suPHP_Engine On' >> /var/www/vhosts/$1/conf/vhost.conf
echo "suPHP_ConfigPath \"/var/www/vhosts/$1/httpdocs/\"" >> /var/www/vhosts/$1/conf/vhost.conf
echo 'AddHandler php5-script .php' >> /var/www/vhosts/$1/conf/vhost.conf
echo 'AddHandler x-httpd-php .php5' >> /var/www/vhosts/$1/conf/vhost.conf
echo 'suPHP_AddHandler php5-script .php' >> /var/www/vhosts/$1/conf/vhost.conf
echo '<Files php.ini>' >> /var/www/vhosts/$1/conf/vhost.conf
echo 'order allow,deny' >> /var/www/vhosts/$1/conf/vhost.conf
echo 'deny from all' >> /var/www/vhosts/$1/conf/vhost.conf
echo '</Files>' >> /var/www/vhosts/$1/conf/vhost.conf
echo 'php_value open_basedir "/tmp/"' >> /var/www/vhosts/$1/conf/vhost.conf
echo "php_value upload_tmp_dir \"/var/www/vhosts/$1/httpdocs/tmp/\"" >> /var/www/vhosts/$1/conf/vhost.conf
echo '</Directory>' >> /var/www/vhosts/$1/conf/vhost.conf
echo '</IfModule>' >> /var/www/vhosts/$1/conf/vhost.conf
/usr/local/psa/admin/bin/websrvmng -u --vhost-name=$1
/etc/init.d/httpd restart
touch suphp_subdomain.sh
chown root:root
chmod 755
vi suphp_subdomain.sh
#!/bin/bash
sleep 30
echo '# PHP version detected 5' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo '<IfModule mod_suphp.c>' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo "<Directory \"/var/www/vhosts/$1/subdomains/$2/httpdocs/\">" >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'php_admin_flag engine on' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'suPHP_Engine On' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo "suPHP_ConfigPath \"/var/www/vhosts/$1/subdomains/$2/httpdocs/\"" >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'AddHandler php5-script .php' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'AddHandler x-httpd-php .php5' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'suPHP_AddHandler php5-script .php' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo '<Files php.ini>' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'order allow,deny' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'deny from all' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo '</Files>' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'php_value open_basedir "/tmp/"' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo "php_value upload_tmp_dir \"/var/www/vhosts/$1/subdomains/$2/httpdocs/tmp/\"" >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo '</Directory>' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo '</IfModule>' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
/usr/local/psa/admin/bin/websrvmng -u --vhost-name=$1
/etc/init.d/httpd restart
Files are ready. Now login to plesk and goto Server --> Event Manager --> Add New Event Handler
select event "Domain created", priority -> lowest, user -> root and in command insert:/usr/local/psa/bin/suphp_domain.sh <new_domain_name>
This will create config file for every new domain you create. The same we have to do for subdomain:
Server --> Event Manager --> Add New Event Handler, select event "Subdomain created", priority -> lowest, user -> root and in command insert:
/usr/local/psa/bin/suphp_subdomain.sh <new_domain_name> <new_subdomain_name>
This will do the same for every subdomain.
Thats all, now you can easy install joomla, wordpress, gallery's and others without any problems with permissions in your new domains created in plesk. I don't know it is compatible with plesk 9.x.
If you already have domains with instaled aplications than you have to change permissions to use with suphp:
find . -type f -exec chmod 644 {} \;; find . -type d -exec chmod 755 {} \;; find . -exec chown <USER>sacln {} \;; service httpd restart
You must change <USER> to your own domain user.
Use it at your own risk.
Thank to atomicrocketturtle.com, linuxhostingsupport.net and other which resourses was very usefull.
after having lot of troubles with joomla, wordpress and others softwares I decided finaly install suphp on my servers. I spend few days for searching and investigating for full automated solution. And at last ... system is working. Here all install manual, how i did. Maybe somewhere I wrong, but this solution is working for me.
First of all, download and install atomic script:
# wget -q -O – http://www.atomicorp.com/installers/atomic | sh
after script is instaled, install mod_suphp
# yum install mod_suphp
Next step is enable suPhp in apache, create suphp.conf file in
# vi /etc/httpd/conf.d/suphp.conf
and insert the following:
LoadModule suphp_module modules/mod_suphp.so
php_admin_value engine off
suPHP_Engine On
AddHandler x-httpd-php .php .php3 .php4 .php5
suPHP_AddHandler x-httpd-php
After that we need to create config for suphp in /etc suphp.conf
[global]
;Path to logfile
logfile=/var/log/suphp.log
;Loglevel
loglevel=warn
;User Apache is running as
webserver_user=apache
;Path all scripts have to be in
docroot=/var/www/vhosts:${ HOME}/httpdocs
;Path to chroot() to before executing script
;chroot=/mychroot
; Security options
allow_file_group_writeable=true
allow_file_others_writeable=false
allow_directory_group_writeable=true
allow_directory_others_writeable=false
;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=false
;Send minor error messages to browser
errors_to_browser=true
;PATH environment variable
env_path=/bin:/usr/bin
;Umask to set, specify in octal notation
umask=0022
; Minimum UID
min_uid=30
; Minimum GID
min_gid=30
; Use correct permissions for mod_userdir sites
;handle_userdir=true
[handlers]
;Handler for php-scripts
php5-script=php:/usr/bin/php-cgi
;Handler for CGI-scripts
x-suphp-cgi=execute:!self
Now we can restart apache:
/etc/inid.d/httpd restart
Install of suphp is done.
Now it's time to configure plesk add suphp in hosts:
cd /usr/local/psa/bin
touch suphp_domain.sh
chown root:root
chmod 755
vi suphp_domain.sh
#!/bin/bash
sleep 30
echo '# PHP version detected 5' >> /var/www/vhosts/$1/conf/vhost.conf
echo '<IfModule mod_suphp.c>' >> /var/www/vhosts/$1/conf/vhost.conf
echo "<Directory \"/var/www/vhosts/$1/httpdocs/\">" >> /var/www/vhosts/$1/conf/vhost.conf
echo 'php_admin_flag engine on' >> /var/www/vhosts/$1/conf/vhost.conf
echo 'suPHP_Engine On' >> /var/www/vhosts/$1/conf/vhost.conf
echo "suPHP_ConfigPath \"/var/www/vhosts/$1/httpdocs/\"" >> /var/www/vhosts/$1/conf/vhost.conf
echo 'AddHandler php5-script .php' >> /var/www/vhosts/$1/conf/vhost.conf
echo 'AddHandler x-httpd-php .php5' >> /var/www/vhosts/$1/conf/vhost.conf
echo 'suPHP_AddHandler php5-script .php' >> /var/www/vhosts/$1/conf/vhost.conf
echo '<Files php.ini>' >> /var/www/vhosts/$1/conf/vhost.conf
echo 'order allow,deny' >> /var/www/vhosts/$1/conf/vhost.conf
echo 'deny from all' >> /var/www/vhosts/$1/conf/vhost.conf
echo '</Files>' >> /var/www/vhosts/$1/conf/vhost.conf
echo 'php_value open_basedir "/tmp/"' >> /var/www/vhosts/$1/conf/vhost.conf
echo "php_value upload_tmp_dir \"/var/www/vhosts/$1/httpdocs/tmp/\"" >> /var/www/vhosts/$1/conf/vhost.conf
echo '</Directory>' >> /var/www/vhosts/$1/conf/vhost.conf
echo '</IfModule>' >> /var/www/vhosts/$1/conf/vhost.conf
/usr/local/psa/admin/bin/websrvmng -u --vhost-name=$1
/etc/init.d/httpd restart
touch suphp_subdomain.sh
chown root:root
chmod 755
vi suphp_subdomain.sh
#!/bin/bash
sleep 30
echo '# PHP version detected 5' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo '<IfModule mod_suphp.c>' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo "<Directory \"/var/www/vhosts/$1/subdomains/$2/httpdocs/\">" >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'php_admin_flag engine on' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'suPHP_Engine On' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo "suPHP_ConfigPath \"/var/www/vhosts/$1/subdomains/$2/httpdocs/\"" >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'AddHandler php5-script .php' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'AddHandler x-httpd-php .php5' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'suPHP_AddHandler php5-script .php' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo '<Files php.ini>' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'order allow,deny' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'deny from all' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo '</Files>' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo 'php_value open_basedir "/tmp/"' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo "php_value upload_tmp_dir \"/var/www/vhosts/$1/subdomains/$2/httpdocs/tmp/\"" >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo '</Directory>' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
echo '</IfModule>' >> /var/www/vhosts/$1/subdomains/$2/conf/vhost.conf
/usr/local/psa/admin/bin/websrvmng -u --vhost-name=$1
/etc/init.d/httpd restart
Files are ready. Now login to plesk and goto Server --> Event Manager --> Add New Event Handler
select event "Domain created", priority -> lowest, user -> root and in command insert:/usr/local/psa/bin/suphp_domain.sh <new_domain_name>
This will create config file for every new domain you create. The same we have to do for subdomain:
Server --> Event Manager --> Add New Event Handler, select event "Subdomain created", priority -> lowest, user -> root and in command insert:
/usr/local/psa/bin/suphp_subdomain.sh <new_domain_name> <new_subdomain_name>
This will do the same for every subdomain.
Thats all, now you can easy install joomla, wordpress, gallery's and others without any problems with permissions in your new domains created in plesk. I don't know it is compatible with plesk 9.x.
If you already have domains with instaled aplications than you have to change permissions to use with suphp:
find . -type f -exec chmod 644 {} \;; find . -type d -exec chmod 755 {} \;; find . -exec chown <USER>sacln {} \;; service httpd restart
You must change <USER> to your own domain user.
Use it at your own risk.
Thank to atomicrocketturtle.com, linuxhostingsupport.net and other which resourses was very usefull.