Collapse

Announcement

Collapse
No announcement yet.

How to install Nginx on cPanel server ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to install Nginx on cPanel server ?

    I need to replace apache web server with nginx. Please provide me step by step instructions for installing nginx on cpanel server.

  • #2
    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
    Then, you can install the Engintron using the following commands from SSH:-

    Code:
    cd /  
    rm -f engintron.sh  
    wget --no-check-certificate https://raw.githubusercontent.com/engintron/engintron/master/engintron.sh  
    bash engintron.sh install
    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:
    0 1 * * * root "/engintron.sh purgecache" >> /dev/null 2>&1
    You can mange the Engintron using the WHM interface. Logged into WHM >> Home >> Plugins >> Engintron for cPanel/WHM.


    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";
    after than need to update the following string in the same file.

    Code:
    if ($host ~ "domain.tld") {
        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.


    To uninstall Engintron, you can use the following command from SSH :-

    Code:
    bash /engintron.sh remove
    That's it.

    Comment

    Working...
    X