How to install Nginx as a webserver in DirectAdmin.

share on:
install Nginx as a web server in Directadmin.

DirectAdmin is a graphical web-based web hosting control panel designed to make administration of websites easier. DirectAdmin, By default, is deployed with the Apache web server. To change web server from Apache (including current websites) to Nginx can be done using Directadmin’s CustomBuild tool. This guide will help you install Nginx as a web server in Directadmin.

NGINX is a free, open-source, high-performance HTTP server and reverse proxy server which is very easy to configure. It has a very low resource consumption and uses an event-driven architecture to handle requests.

NGINX accelerates content and application delivery, improves security, facilitates availability and scalability for the busiest websites on the Internet.

NGINX is one of a handful of servers written to address the C10K problem. Click here to know more about C10K problem.

 

Ok, let’s start this tutorial on how to install Nginx as a web server in Directadmin.

Steps involved in Installing Nginx in Directadmin.

  1. Upgrade Directadmin to CustomBuild 2.0.
  2. Install Nginx with PHP-FPM in DireactAdmin.

 

Upgrade Directadmin to CustomBuild 2.0.

First of all, If you are using Custombuild 1.x, upgrade Directadmin to CustomBuild 2.0. If you are already using CustomBuild 2.0 then you can skip this step.

Check which version you are using:

shell> cd /usr/local/directadmin/custombuild
shell> ./build version

 

Upgrade to CustomBuild 2.0.

shell> cd /usr/local/directadmin
shell> mv custombuild custombuild_1.x
shell> wget -O custombuild.tar.gz http://files.directadmin.com/services/custombuild/2.0/custombuild.tar.gz
shell> tar xvzf custombuild.tar.gz
shell> cd custombuild
shell> ./build

 

 

Install Nginx web server with PHP-FPM in Directadmin.

Now that we have upgraded to CustomBuild 2.0, we can use these commands to switch web server from Apache to Nginx. we will also use PHP-FPM with Nginx.

shell> cd /usr/local/directadmin
shell> ./build set webserver nginx

 

install Nginx as a web server in Directadmin

 

 

shell> /build set php1_mode php-fpm

 

install Nginx as a web server in Directadmin

 

 

shell> ./build update

 

install Nginx as a web server in Directadmin
How to install Nginx as a web server in Directadmin. – DebYum

 

shell> ./build all d

 

This whole process will take close to 20 minutes depending upon the size of RAM  and Processing power of  your VPS.

 

shell> ./build rewrite_confs

 

Final result.

install Nginx as a web server in Directadmin
How to install Nginx as a web server in Directadmin. – DebYum

 

You may need restart Nginx in DirectAdmin with this command :

shell> /sbin/service nginx restart

 

All the Nginx Configuration files will be stored in /etc/nginx directory.

The additional Nginx configuration files related to your Domain can be found in:

shell> cd /usr/local/directadmin/data/users/username/
shell> ls -l | grep nginx
-rw-r----- 1 diradmin username 1541 Nov 26 19:27   nginx.conf
-rw-r--r-- 1 diradmin diradmin 407  Nov 26 16:34    nginx_php.conf

 

Now you have installed Nginx in your DirectAdmin server. Also, configure FastCGI cache and Zend Opcache to speed up your PHP application. Good day.

Peace.

 

 

share on:
engy

engy

Hello there, My name is Rishi Guleria and I work as a Linux system administrator. I have created this blog to share what I have learned so far and to learn new things. Don't forget to leave the feedback. Have a great day. :)

Leave a Response

share on: