I installed suPHP on a plesk box, works great for all the client vhost websites, all their PHP scripts run with their respective user account privellages.
However, suPHP was enabled for every PHP script which ran under apache. This caused a few issues ...
Especially for the webmail php scripts, which reside in /usr/share/psa-horde/
When I tried to access webmail, the browser was giving me back an Internal Server Error and I was seeing these in the log files:
/var/log/suphp/suphp.log
[warn] UID of script "/usr/share/psa-horde/index.php" is smaller than min_uid
[warn] Script "/usr/share/psa-horde/index.php" resolving to
"/usr/share/psa-horde/index.php" not within configured docroot
/var/log/apache2/error_log
[error] [client X.X.X.X] SoftException in Application.cpp:199: Script "/usr/share/psa-horde/index.php"
resolving to "/usr/share/psa-horde/index.php" not within configured docroot
If you look in the suphp config file /etc/suphp/suphp.conf you will see that the docroot is /var/www/, any scripts outside this location will not be executed. I played around a bit with permissions and config files, in the end this is the solution I came up with :
Step 1: Edit /etc/apache2/mods-enabled/suphp.conf
Comment out everything, this will prevent suPHP from affecting every php script on your site.
<IfModule mod_suphp.c>
# AddHandler x-httpd-php .php .php3 .php4 .php5 .phtml
# suPHP_AddHandler x-httpd-php
# suPHP_Engine on
# # Use a specific php config file (a dir which contains a php.ini file)
# suPHP_ConfigPath /etc/php4/cgi/suphp/
# # Tells mod_suphp NOT to handle requests with the type <mime-type>.
# suPHP_RemoveHandler <mime-type>
</IfModule>
Step 2: Make a new file: /etc/apache2/conf.d/zzz_su_php.conf
Enable suPHP only for your plesk vhosts.
Put this in the file:
<Directory "/var/www/vhosts">
<IfModule mod_suphp.c>
AddHandler x-httpd-php .php .php3 .php4 .php5 .phtml
suPHP_AddHandler x-httpd-php
suPHP_Engine on
</IfModule>
</Directory>
Now suPHP will only affect your client websites running under /var/www/vhosts, and not your other global webmail etc.. scripts.
Hope it helps someone.
Dave
|
Collector Comics is THE place to buy, sell, and research comics online. Launching soon.
Launch »
Screenshot »
|
|
Webitor is a kick-ass easy to use, easy to extend, non-database driven Content Management System. Version 2 with reseller plan coming soon.
Launch »
Version 1 »
|
|
GC Lounge is my own pet social network and test bed for social related code. Made by locals for locals.
Launch »
|
|
GG has indexed over half a million recent Trade Mark applications. This revolutionary tool is extremely valuable for industry experts.
Launch »
|
|
GCWiFi is the hub for techies interested in joining a ad-hoc wireless mesh spread across the Gold Coast
Launch »
|
|
Web based financial client management system
Launch »
|
|
OS Commerce modules and template modification
Launch »
|
| View More Projects » | |