Install nginx on cPanel server
Install nginx on cPanel server
Date Posted: 15-11-2017
cPanel is the widely used control panel to manage webhosting and it comes with apache as a default webserver. Nginx is fast webserver when compared to apache webserver. In this tutorial, we will explain on how to install nginx on cpanel server.
We will be using engintron plugin and install nginx on this article. Engintron will install nginx and change the apache port 8080 whereas nginx will listen on port 80
Assumption:
- cPanel Server
- SSH root access
- WHM access(https://IP ADDRESS:2087)
Implementation:
Login to server as root
Download the engintron using wget.
wget --no-check-certificate https://raw.githubusercontent.com/engintron/engintron/master/engintron.sh
Install the engintron using the below command.
bash engintron.sh install
The installation will little time to complete.
Once, the installation completed, you will see a plugin on WHM as mentioned in the below screenshot.
Click on theĀ Engintron for cPanel/WHM.
On the new window, we can see engintron panel and restart the nginx and apache service.
Verification:
1. Check the nginx status inside the server.
/etc/init.d/nginx status
2. Send a CURL request to the domain and you can see the below output which confirms that nginx is successfully installed on cPanel server.
curl -I domain.tld
Server: nginx
Date: Thu, 16 Nov 2017 05:16:55 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Location: http://domain.tld/
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Nginx-Cache-Status: MISS
X-Server-Powered-By: Engintron