Home DirectAdmin Setup reverse-proxy NGINX-Apache Directadmin

Setup reverse-proxy NGINX-Apache Directadmin

by Thạch Phạm

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:

AZDIGI Tutorial
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 directorycustombuild .
  • Command 2: Adjust configurationwebserver Fortnginx_apache .
  • Command 3: Update againcustombuild script .
  • Command 4: Set PHP1 version mode tophp-fpm .
  • Command 5: Set PHP2 version mode tophp-fpm .
  • Command 6: Set PHP3 version mode tophp-fpm .
  • Command 7: Set PHP4 version mode tophp-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:

reverse-proxy NGINX_Apache Directadmin
Commands 1 and 2: Move to directorycustombuild and adjust the configurationwebserver Fortnginx_apache .
Command 3: Update againcustombuild script .
Command 8: Install reverse-proxy NGINX_Apache Directadmin.
Command 10: Re-use your custom configuration, but if you want everything default, ignore this command.

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.

Versionnginx just installed mine is 1.19.1
VersionApache just installed my 2.4.43 .

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.

reverse-proxy NGINX_Apache Directadmin

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:

5/5 - (1 vote)

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