This is based on a CentOS server with Apache 2.x.

You no longer need to install the module to chmod config files to 666 or upload/merge folders with 777. Because with this module enabled everything on HTTP will run with it and not through ‘apache’.

** If you are using mod_ruid instead of mod_ruid2, first of all remove the mod_ruin line from the path ‘/etc/httpd/conf/httpd.conf’

First, we will enable libcap-devel

Once that is done we will download and install mod_ruid2.

Now, if you don’t get errors, mod_ruid2 should be installed and added to ‘etc/httpd/conf/httpd.conf’

Let’s make sure it was added correctly.

If you get a response like this, then it has been added.

Now we need to convert the DA httpd.conf templates a bit to enable mod_ruid2 for users.

Now copy the template files to custom

You have now copied the original templates to the ‘custom’ folder, so they will not be deleted

Now follow the steps for each virtual_host2 file you copied.

Replace the line:

With:

Add the lines below with the line you just replaced.

Save the files and rewrite the HTTPd config files.

If you want you can start rewriting the HTTPd config files manually, just paste the line below and wait for it to finish.

After the rewrite is finished you can restart HTTPd with the command below.

Now mod_ruid2 should be installed and you don’t need chmod anymore, e.g. ‘chmod 666 config.php’ or ‘chmod777 uploads’.

To be sure that the webmail clients still work we need to change the owner permissions.

Finally, you need to change httpd-directories.conf

Add the RUidGid line below between and and

 

Q: How can I test this is working?
A: Easy, install some CMS that you are used before. Like WordPress, Joomla that required (before!!) chmod 666 or 777 to get install/working.

Q: I’ve dirs/files owned by apache for some users, must I change this?
A: Yes, you need to give the dirs/files owner of the user itself, not apache anymore. Check below

To fix the owner permissions of the dirs/files

* Added ‘&&’ so if they do a typo, it won’t change anything.

Finally, if you have problem with perl it should be root:root and not root:apache:

 

source: http://forum.directadmin.com/showthread.php?t=37467