Working With SuPHP Permissions and Ownership

I switched one of my web servers over to use SuPHP a few weeks ago, as it’s a lot more secure.

However moving from mod_php to suPHP does require a small bit of tweaking of files and directories.

Under mod_php you can easily end up with a lot of files and directories being owned by the Apache user, which on Debian / Ubuntu is “www-data”. You’ll need to change the ownership of all those files to the website user.

The other thing to watch out for is permissions – setting them to 644 should fix any errors you’re getting.

Another issue I ran into was this error in the logs:

SoftException in Application.cpp:564: Directory “/home/www/www.xxxx.xx/web” is writeable by group

Solution is to chmod 755 the web directory.

After doing a default install and configuration of SuPHP you might run into difficulties running PhpMyAdmin, as the standard SuPHP configuration will forbid it.

The fix is to tweak the settings add the following to your main suphp.conf :

<Directory /usr/share/phpmyadmin>
        suPHP_Engine on
    </Directory>

 

By Michele Neylon

Michele is founder and CEO of Irish hosting provider and domain name registrar Blacknight.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Exit mobile version