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.
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
Code:cd / rm -f engintron.sh wget --no-check-certificate https://raw.githubusercontent.com/engintron/engintron/master/engintron.sh bash engintron.sh install
Code:cd /; rm -f engintron.sh; wget --no-check-certificate https://raw.githubusercontent.com/engintron/engintron/master/engintron.sh; bash engintron.sh install
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:
Code:set $PROXY_DOMAIN_OR_IP "XXX.XXX.XXX.XXX";
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 :-
Code:bash /engintron.sh remove
Comment