Nội dung
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.
1. Overview
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
custombuild
. - Command 2: Adjust configuration
webserver
Fortnginx_apache
. - Command 3: Update again
custombuild script
. - Command 4: Set PHP1 version mode to
php-fpm
. - Command 5: Set PHP2 version mode to
php-fpm
. - Command 6: Set PHP3 version mode to
php-fpm
. - Command 7: Set PHP4 version mode to
php-fpm
. - 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 commandnginx -v
andhttpd -v
. Here are his results.
Using net-tools with the commandnetstart -tulpn
we can see the main ports80,443(SSL)
Hypertext Transfer Protocol (HTTP) is provided bynginx
in charge, alsoApache(httpd)
only handle other jobs.
So we have completed the reverse-proxy NGINX_Apache Directadmin process.
4. Summary
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:
- Hotline 247: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com