Take ownership of user folder


In GPL version, files uploaded via php have ownership apahe :wink:

Maybye, create script, running dayly from CRON, who take ownership of user homedirectory, drop apache ownership and put user (from name of folder) for owner?

Is this possible ?


Install mod_fcgid (Debian/Ubuntu have it in their repos, and our GPL CentOS 4 and 5 yum repositories also have it). Rebuild Apache to have suexec_docroot set to /home (or install our package–we have them available for Debian 4.0, Ubuntu 8.04, CentOS 4 and 5, otherwise you’ll have to rebuild yourself).

Once that’s done, add to the VirtualHost section:

SuexecUserGroup "#501" "#501"

Replacing the #501 above with the UID and GID of your virtual server.

Then, in the public_html Directory section:

AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/doxfer/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/doxfer/fcgi-bin/php5.fcgi .php5

Replacing "doxfer" in the above with the home of your virtual server.

Create the directory fcgi-bin in the home directory, and create a file called php5.fcgi, containing the following:

export PHPRC
exec /usr/bin/php-cgi

Copy /etc/php.ini to the etc/php5 directory within the users home (create the directory, if it doesn’t exist, e.g. /home/doxfer/etc/php5/php.ini )

Permissions on the fcgid-wrapper should be 750 and it should be owned by the virtual server user and group.

Ownership of all application files in public_html must be set to the user and group of the virtual server user and group, and permissions must also be 750 or less (anything higher and suexec will refuse to run it).

Restart apache. Cross your fingers. Test.

Check the suexec_log and error_log if anything goes wrong.

The easiest would be to use yum. You can setup our repositories (including the Webmin stuff, and the binary stuff, in two different repos):

rpm -ivh http://software.virtualmin.com/gpl/centos/5/x86_64/virtualmin-release-1.0-1.rhel.gpl.noarch.rpm

Or, you can get the individual packages from:



We also provide a mod_fcgid package and you’ll need mod_ssl from there as well, since it ties very tightly to the httpd version).

Thank, you for response.

Can you tell me, how can I install your build of apache, who have included suexec_docroot.
I’m use, centos 5.