Home WebServer PanelDirectAdmin Install mod_ruid2 on DirectAdmin

Install mod_ruid2 on DirectAdmin

by Thạch Phạm
Published: Last Updated on

In this article, AZDIGI will guide you to install mod_ruid2 on DirectAdmin easily.

I. What is Mod_ruid2?

Mod_ruid2 is a module for the Apache web server that takes advantage of POSIX. Mod_ruid2 provides improved performance with greater security for hosted websites. This means that mod_ruid2 makes web pages load faster and increases the site’s security.

When using this Apache module, the web pages hosted on the server have to process PHP under the ownership of the user instead of Apache, which should help fix a few problems in different scenarios. DirectAdmin can be configured to use the mod_ruid2 module for performance and security-wise growth. When comparing the suPHP and mod_php + mod_ruid2 setup (both setups will run PHP as the user), here are the advantages of the mod_ruid2 setup:

  • Less disk I/O is required since mod_php is already preloaded in Apache, thus bypassing loading the php binary and mod_php’s libraries each time.
  • The settings can be changed for an individual domain using the php.ini file.
  • It is possible to use PHP OpCache with this setup for much higher performance.

Note: To do this tutorial, you need to ensure that your server is running PHP as mod_php and that the webserver you are using is Apache.

II. Install mod_ruid2 on DirectAdmin

To install mod_ruid2 on DirectAdmin, follow these 4 steps.

Step 1: SSH into your server

To install mod_ruid2 on DirectAdmin, we first need to SSH or access your VPS/server with root privileges. Or at least log in to the server with a user with sudo privileges. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:

After successfully SSH, we continue with step 2 to perform the commands to check the CustomBuild version.

Step 2: Check the CustomBuild version

To continue the installation, we need to check if the version of CustomBuild we are using is 2.0 or not. To check the version of CustomBuild you are using, please check out the following short tutorial:

In case your CustomBuild version is lower than 2.0 then you need to upgrade CustomBuild 1.x to 2.0 , you can check out the following tutorial:

After having the CustomBuild 2.0 version, we continue to the last step, execute the mod_ruid2 installation commands on DirectAdmin.

Step 3: Execute the command to install mod_ruid2 on DirectAdmin

To install mod_ruid2 on DirectAdmin, we use the commands:

AZDIGI Tutorial
cd /usr/local/directadmin/custombuild/
./build update
./build set mod_ruid2 yes
./build mod_ruid2
./build rewrite_confs

Explanation of the above commands:

  • Command 1: Move to the custombuild folder.
  • Command 2: Update Custombuild Script to the latest.
  • Command 3: Enable the mod_ruid2 option from No to Yes.
  • Command 4: Install mod_ruid2.
  • Command 5: Rebuild the entire configuration on the server. The configurations in /custombuild/custom will be preserved.

Below is the progress:

install mod_ruid2 on DirectAdmin
Commands 1, 2, 3.
install mod_ruid2 on DirectAdmin
Command 4.
install mod_ruid2 on DirectAdmin
Command 5.

At this step, we install mod_ruid2 on DirectAdmin to complete. However, we will have one more last step to make sure the folder/file executable permissions are right for them, we execute the following commands to finish:

AZDIGI Tutorial
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;

III. Summary

Hopefully, the article installing mod_ruid2 on DirectAdmin will help you improve the performance of your Apache server and make it more secure.

See more useful articles about DirectAdmin at the following link:

If you need assistance, you can contact support in the ways below:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign