Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: mod_suphp installation on Plesk 11  (Read 2149 times)

0 Members and 1 Guest are viewing this topic.

lijeshk

  • Guest
mod_suphp installation on Plesk 11
« on: December 03, 2013, 12:40:44 am »

Installation :

Setup the RPMforge repo for Centos 6.x 64 bit:
Code: [Select]
#rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
For Centos 6.x 32 bit :
Code: [Select]
#rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
Now we can install mod_suphp using yum:
Code: [Select]
#yum install mod_suphp
Configuration :

Insert below given lines to  /etc/suphp.conf file:

Code: [Select]
[global]
;Path to logfile
logfile=/var/log/suphp.log

;Loglevel
loglevel=info

;User Apache is running as
webserver_user=apache

;Path all scripts have to be in
docroot=/var/www/vhosts

;Path to chroot() to before executing script
;chroot=/mychroot

; Security options
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false

;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=true

;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

[handlers]
;Handler for php-scripts
php5-script="php:/usr/bin/php-cgi"

Insert the below given lines to /etc/httpd/conf.d/mod_suphp.conf:

Code: [Select]
LoadModule suphp_module modules/mod_suphp.so


### Uncomment to activate mod_suphp
suPHP_AddHandler php5-script


# This option tells mod_suphp if a PHP-script requested on this server (or
# VirtualHost) should be run with the PHP-interpreter or returned to the
# browser "as it is".
suPHP_Engine on

Insert the below given lines to /etc/httpd/conf.d/php.conf file:

Code: [Select]
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php5_module modules/libphp5.so

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps

Vhost configuration:

Add the below given lines to vhost.conf to activate mod_suphp:

Code: [Select]
suPHP_Engine On
suPHP_UserGroup username psacln
suPHP_ConfigPath /var/www/vhosts/domain.com/etc


Restart apache/httpd service for the changes to take effect.


That's it!
--

 :)