blog posts

hosting image

Install mod_ruid2 on DirectAdmin

< All Topics
You are here:


Set up mod_ruid2 on DirectAdmin

The mod_ruid2 is a suexec module for Apache net server which takes benefit of POSIX. The mod_ruid2 will present an improved efficiency with higher safety for the web sites hosted on the server. This implies the mod_ruid2 makes the web sites load quicker and in addition enhance the safety of the web site. When utilizing this Apache module, the web sites hosted on the server ought to course of the PHP underneath the consumer possession fairly than Apache consumer, it will assist in troubleshooting numerous conditions. DirectAdmin will be configured to make use of mod_ruid2 module to have this efficiency smart and safety smart hike. When evaluating suPHP and mod_php + mod_ruid2 setup (each setups will run PHP because the consumer), the under are some great benefits of mod_ruid2 setup:

1) Much less disk I/O required –  mod_php already loaded in Apache, so this may ignore loading php binary and its libraries every time.

2) The settings will be modified for a person area identify utilizing php.ini file.

3) We are able to use PHP OpCache together with this setup to have far more efficiency.


To have this arrange you must verify first the server is working PHP as Apache module. It is extremely straightforward to configure/arrange the mod_ruid2 on a DirectAdmin server having custom-build 2.

1) First ensure you are working PHP as Apache module, which implies there ought to have the mod_php module put in together with Apache. By default, this arrange has no safety, because the processes can have Apache consumer no one possession there. By enabling mod_ruid2 it will change to the consumer, fairly than no one consumer. Login to the server through command line and execute under command to ensure you run PHP as mod_php.

# grep php1_mode=mod_php /usr/native/directadmin/custombuild/choices.conf -c

It’ll give “1” as output if it runs mod_php. If it exhibits 1, then go forward to the following step.

2) To put in mod_ruid2 module, run the under instructions one after the other on the server. Please guarantee there are not any errors in every step in any other case it might trigger severe points on the server.

#cd /usr/native/directadmin/custombuild/

#./construct replace

#./construct set mod_ruid2 sure

#./construct mod_ruid2

#./construct rewrite_confs

If all went superb with none errors, then it’s time to right the present recordsdata and folders permission on the server.

3) To right the possession and permissions, execute the under instructions one after the other as root consumer on the server.

# cd /usr/native/directadmin/scripts && ./ user_homes

# discover /house/*/domains/*/public_html -type d -print0 | xargs -Zero chmod 755

# discover /house/*/domains/*/public_html -type f -print0 | xargs -Zero chmod 644

# discover /house/*/domains/*/public_html -type f -name ‘*.cgi*’ -exec chmod 755 ;

# discover /house/*/domains/*/public_html -type f -name ‘*.pl*’ -exec chmod 755 ;

# discover /house/*/domains/*/public_html -type f -name ‘*.pm*’ -exec chmod 755 ;

#cd /usr/native/directadmin/knowledge/customers && for i in `ls`; do chown -R $i:$i /house/$i/domains/*/public_html;; achieved;

That’s it, you will have put in and configured the mod_ruid2 inside Apache to have higher efficiency and safety.


Please be at liberty to get in contact with our help workforce in case you ought to require help in organising the above.


Knowledge Base Articles