DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

How to install mod_ruid2 on Directadmin server?

| 22:09:33 24.11.2016

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!

Directadmin and Custombuild 2

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.


It's high time to correct 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!

About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.




All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition