Installing NGinx on a CPanel Server Manually

To install NGinx on cPanel servers we recommend you use the product NGinxCP available at http://www.nginxcp.com

This is a free plugin for cPanel.

    1. Login to WHM on your server
    2. Go to WHM -> Clusters -> Remote Access Key. Click 'Generate a new access key'
    3. See: http://www.nginxcp.com/installation-instruction/ for the latest installation instructions. It is very simple and you need to login to your server via SSH before you can complete the following commands:

      cd /usr/local/src
      wget http://nginxcp.com/latest/nginxadmin.tar
      tar xf nginxadmin.tar
      cd publicnginx
      ./nginxinstaller install
      mv /scripts/after_apache_make_install /scripts/posteasyapache
      yum install tmpwatch -y
      crontab -e
      copy this line: 0 */1 * * * /usr/sbin/tmpwatch -am 1 /tmp/nginx_client
      scroll to the bottom of the crontab entries so the cursor is on a blank line, then right click to paste that line in
      Press CTRL O to save the file
      Press CTRL X to exit

  1. Now login to WHM again and go to Plugins. You will now see the Nginx Plugin. You should now be able to test to see if the changes have worked.
    Note: If you have no active accounts Nginx will not start properly. So you should create an account in WHM -> Account Functions -> Create a New Account then go to WHM -> Plugins -> Nginx Admin and click 'Restart Nginx'
    There is an article on common issues here: http://www.nginxcp.com/forums/Thread-nginxcp-faq-read-before-you-post

  2. Now go to WHM -> Plugins -> ConfigServer Security&Firewall
    Go to the ldf - Login Failure Daemon section and there is a drop down box which has csf.ignore selected. Change this to: csf.pignore then click 'Edit'
    Add the lines:
    exe:/usr/sbin/nginx
    exe:/usr/local/sbin/nginx

    Click 'Change'
    Click 'Restart LFD'

    This ensures you are not notified about nginx running constantly by the system.

  3. If you are getting random 'Internal server errors' accessing your site, you will need to go to WHM -> Plugins -> NGinx Admin
    Click on 'Configuration Editor'
    Change the line:
    worker_processes auto;
    to
    worker_processes 5;
    Check 'Restart Nginx' and click 'Update'
  • 5 Users Found This Useful
這篇文章有幫助嗎?

相關文章

Create and setup your own name (DNS) servers in WHM

Setting up your own private nameservers on a cPanel server has many benefits, most importantly...

Expanding Disk Space on VPS (SSD)

If you have requested additional SSD space, there may be a need for you to manually expand the...

Maintaining a CPanel/WHM VPS

If you have got a CPanel/WHM based VPS and are not sure on how you should monitor and maintain it...

Connect to your VPS via SSH

Learn how to connect to your Linux VPS via SSH. This guide will give you the process to connect...

How to install Plesk On Linux

When it comes to top-tier web hosting control for business needs, Plesk surely deserves a spot on...