Should you want to run PHP scripts in behalf of the script owner. Or you have issues with modifying uploaded via HTTP files in a FTP client or in Directadmin File Manager. Probably you see various errors similar to "Permission denied". In such a case you might consider installing mod_ruid2 to your mod_php.
Please be careful, as if you have not standard setup and/or share content between different user accounts on a server you will need to re-configure it. Or even stop here!
With custombuild 2 on a Directadmin server it is a matter only of several minutes to get mod_ruid2 installed. First of all make sure you run PHP as mod_php:
grep php1_mode=mod_php /usr/local/directadmin/custombuild/options.conf -c
It should give 1. In this case you have mod_php, and can go further with the guide.
If you see 0 then you don't run PHP as mod_php and you should not follow this guide. If you have a mentioned earlier issue with permissions then you should investigate it more thoroughly. Feel free to contact us to get our administrator to check your server.
Here are commands which you should run as root in console to get it done:
cd /usr/local/directadmin/custombuild/ ./build update ./build set mod_ruid2 yes ./build mod_ruid2 ./build rewrite_confs
OK, you've got it installed! Now you should correct existing permissions and ownership of files and directories, as you might have numerous files owned by apache with 777 permissions.
With these commands you will get correct and default permissions:
cd /usr/local/directadmin/scripts && ./set_permissions.sh user_homes find /home/*/domains/*/public_html -type d -print0 | xargs -0 chmod 755 find /home/*/domains/*/public_html -type f -print0 | xargs -0 chmod 644 find /home/*/domains/*/public_html -type f -name '*.cgi*' -exec chmod 755 {} \; find /home/*/domains/*/public_html -type f -name '*.pl*' -exec chmod 755 {} \; find /home/*/domains/*/public_html -type f -name '*.pm*' -exec chmod 755 {} \; cd /usr/local/directadmin/data/users && for i in `ls`; do { chown -R $i:$i /home/$i/domains/*/public_html;}; done;
That's it!