I need to replace apache web server with nginx. Please provide me step by step instructions for installing nginx on cpanel server.
Collapse
Announcement
Collapse
No announcement yet.
How to install Nginx on cPanel server ?
Collapse
X
-
Bydefault cPanel doesn't support Nginx. There are some third party tools that offer Nginx installation on the cpanel some of them are paid like cpnginx & Engintron. But you can try Engintron which is free and have been tested by us on many cPanel servers. It works absolutely great !!
Use following steps to install Engintron (nginx) on cpanel server:
First, take a backup of current Apache configuration file using the following command from SSH.
Then, you can install the Engintron using the following commands from SSH:-Code:cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf_old OR cp /etc/apache2/conf/httpd.conf /etc/apache2/conf/httpd.conf_old
Or use one command to install it:-Code:cd / rm -f engintron.sh wget --no-check-certificate https://raw.githubusercontent.com/engintron/engintron/master/engintron.sh bash engintron.sh install
and then you will setup a daily cron to clear the Engintron purgecache:-Code:cd /; rm -f engintron.sh; wget --no-check-certificate https://raw.githubusercontent.com/engintron/engintron/master/engintron.sh; bash engintron.sh install
You can mange the Engintron using the WHM interface. Logged into WHM >> Home >> Plugins >> Engintron for cPanel/WHM.Code:0 1 * * * root "/engintron.sh purgecache" >> /dev/null 2>&1
If you have some websites on dedicated IP's then you will need to update "custom_rules" Nginx configuration(/etc/nginx/custom_rules) file with the below setting with the server IP:
after than need to update the following string in the same file.Code:set $PROXY_DOMAIN_OR_IP "XXX.XXX.XXX.XXX";
Replace the actual domain name with "domain.tld" and the associated dedicated IP for "xxx.xxx.xxx.xxx" with the actual IP address.Code:if ($host ~ "domain.tld") { set $PROXY_DOMAIN_OR_IP "xxx.xxx.xxx.xxx"; }
To uninstall Engintron, you can use the following command from SSH :-
That's it.Code:bash /engintron.sh remove
Comment