How to install nginx as a reverse proxy on WHM?

How to install nginx as a reverse proxy on WHM?

By default the Linux server is already loaded with Apache but WHM server does not provide any support for Nginx web server. To make your website both effective and powerful then you need both web servers Apache and Nginx. Nginx web server is mainly responsible for website’s speed and apache makes it powerful with its inbuilt features. In this article we are going to discuss that how to install Nginx web server as n reverse proxy server. But first we are going to explain about the advantage of Nginx server as a reverse proxy on cpanel server.

Why we have to run Nginx and apache both on server?

Apache is an open source web server which is based on UNIX operating system. It is mostly used web server and available for free. Apache is reliable, fast and secure web server. As already discussed Nginx increase the speed of website so if we set Nginx as reverse proxy server then it can increase the speed and performance both.

Nginx is responsible for the management of all the static web page content like images, CSS, MP4, SWF files and more. As you know apache is responsible for dynamic requests like php pages. Apache manages all the dynamic requests (php pages, javascript, etc).

Now we all know about the Nginx server and why we have to use it so now it’s time to install Nginx web server as a reverse proxy server.

How to install Nginx as a reverse proxy on cpanel server?

1. Login to server via SSH access.

2. After login change to src directory with below command:

Code:
cd /usr/local/src
3. Now download the plugin with wget command:

Code:
wget http://nginxcp.com/latest/nginxadmin.tar
4. The downloaded file is in tar format so you have to extract the compressed plugin:

Code:
tar xf nginxadmin.tar
5. Change the directory through:

Code:
cd publicnginx
6. Now create the directory for apps with the below command:

Code:
mkdir /var/cpanel/apps && chmod 755 /var/cpanel/apps
7. With the install tag run the installer program:

Code:
./nginxinstaller install
8. After all the above steps the nginx option is now available user plugins section in WHM. You can check it with the following command :

Code:
# ps aux | grep nginx
9. If you didn’t find any processes then you restart the apache with following command:

Code:
#killall -9 httpd
#/etc/init.d/httpd restart
Author
bhawanisingh
Views
2,116
First release
Last update
Rating
0.00 star(s) 0 ratings
Top