When the DirectAdmin installation is complete, it will use Apache as the default webserver. However, in many cases, using Apache as a webserver will not give optimal speed. So in DirectAdmin, we have one more option which is to use NGINX as the reversed proxy for Apache to have faster website access speed.
In this article, I will guide reverse-proxy NGINX – Apache Directadmin to speed up the processing of websites with static content as well as directives on the web.
.htaccess like Apache webserver.
Nginx, stylized as NGINX or nginx or NginX, is a web server that can also be used as a reverse proxy, load balancer, mail proxy, and HTTP cache. The software was created by Igor Sysoev and released to the public in 2004.
With many comparison tests between Nginx and Apache (default webserver when installing DirectAdmin), Nginx has better performance in static websites. As for dynamic websites, both give the same performance.
However NGINX does not support files
.htaccess so if you use WordPress you will need reverse-proxy NGINX_apache to be able to use the directives in
.htaccess Okay. We continue the following steps to reverse-proxy NGINX_Apache Directadmin.
2. SSH into your DirectAdmin system
To use reverse-proxy NGINX_Apache Directadmin, we first need to SSH or access your VPS or server with root privileges first. If you do not know how to SSH into your VPS/Server, you can refer to the following tutorial:
After successfully SSHing, we continue with the next step to check the necessary conditions before reverse-proxy NGINX_Apache Directadmin.
2. System requirements before installing Nginx DirectAdmin webserver
To use reverse-proxy NGINX_Apache Directadmin, your VPS/Server hardly needs too many conditions at all, just the CustomBuild 2.0 version can be installed.
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 CustomBuild 2.0 we continue the following steps to reverse-proxy NGINX_Apache Directadmin.
3. Instructions for reverse-proxy NGINX_Apache Directadmin
We continue to use the following commands to reverse-proxy NGINX_Apache Directadmin:
cd /usr/local/directadmin/custombuild ./build set webserver nginx_apache ./build update ./build set php1_mode php-fpm ./build set php2_mode php-fpm ./build set php3_mode php-fpm ./build set php4_mode php-fpm ./build nginx_apache ./build php n ./build rewrite_confs
Explanation of the above commands:
- Command 1: Move to directory
- Command 2: Adjust configuration
- Command 3: Update again
- Command 4: Set PHP1 version mode to
- Command 5: Set PHP2 version mode to
- Command 6: Set PHP3 version mode to
- Command 7: Set PHP4 version mode to
- Command 8: Install reverse-proxy NGINX_Apache Directadmin.
- Command 9: Reinstall the entire PHP version to be compatible with the new configuration.
- Command 10: Reuse your custom configuration, but if you want everything default, ignore this command.
Below is an image of the order when executing the above commands and annotating each image:
So we have completed the reverse-proxy NGINX_Apache Directadmin process. To see the version of Nginx and Apache you are using, use the command
nginx -v and
httpd -v . Here are his results.
Using net-tools with the command
netstart -tulpn we can see the main ports
80,443(SSL) Hypertext Transfer Protocol (HTTP) is provided by
nginx in charge, also
Apache(httpd) only handle other jobs.
So we have completed the reverse-proxy NGINX_Apache Directadmin process.
So you know how to install reverse-proxy NGINX_Apache Directadmin. Switching to this configuration will help your VPS/Server handle better static websites compared to standalone use. Apache and will also support files
.htacces makes popular source codes like WordPress work without errors
If you find the article useful, don’t forget to rate 5 stars.
Wishing you success.
See more useful articles about DirectAdmin at the following link:r
If you need assistance, you can contact support in the ways below: