How to install Nginx on cPanel – Nginx cPanel plugins vs Manual Nginx installation

Nginx is a lightweight web server and a reverse proxy server that is famous for low system resources usage, fast delivery of static content and dynamic content if using FastCGI, CSGI and other handlers. Nginx has proved itself as a reliable software load balancer and as a caching server.

Table of Contents

Introduction

Manual Nginx installation

Automatic Nginx installation

Summary

External links

Introduction

You always get what you want… Before I tried to install Nginx on cPanel based server I practised with it a lot. I already installed it on several servers running Apache. It was running there as a reverse proxy and somewhere as a caching server. So when I got a task to install Nginx on cPanel I searched Google for something like “apache nginx cpanel install” and I found an article nginx + apache = happy & fast cPanel server that guided me through manual installation process…

But manual installation has some issues and I am going to describe them in the next section.

Manual Nginx installation

Manual Nginx installationIf you are reading this section I assume that you are already familiar with Nginx, Apache and cPanel, you know what mod_rpaf is and how to install software from source. At least you should have good copy/paste skills and you should not afraid of black console screen. :)

Though I used nginx + apache = happy & fast cPanel server guide as a starting point I made some changes to this guide:

  1. Since I installed Nginx using “yum” package installer and not from source I had to change all configuration paths from “/usr/local/nginx/conf/vhost.conf” to “/etc/nginx/conf/vhost.conf”.
  2. I uncommented the “location” section since I wanted to serve static files by Nginx.
  3. I removed “htm|html” from the extension list since some WordPress sites on that server had permalinks ended in “.html” or “.htm”.

Nginx worked like a charm. The main issue I faced later when I had to re-run the configuration script each time I added new domain or a sub-domain to my account. Author of “nginx + apache” article said that it is possible to setup a hook for cPanel scripts, that will reconfigure Nginx automatically, but I did not find this “hook” and the lack of Perl knowledge did not allow to do it myself.

Only a month or two later I found that the plugins that allowed you to install Nginx on the cPanel server automatically and “out of the box” already existed.

Automatic Nginx installation

automatic nginx installationThere are several cPanel plugins available that allow you to install Nginx on the cPanel server automatically with a minimum technical skills required.

Nginx Admin by http://nginxcp.com/ – free Nginx plugin for cPanel. As I can see from their blog, project is active and updated monthly. You can get a free installation if you donate any amount more than $10.

cPaneL Nginx by http://syslint.com – product homepage - http://cpnginx.com/. Plugin available at 5$/Month for Individual licence and at 3$/Month for Datacenter license. Has 15 days trial period.

NGINX Integration by http://www.remsys.com/ – product homepage – http://www.setupnginx.com/. Plugin available at $20 one time licence and at $10 if you use coupon code “NGINX”. :)

Please let me know if I missed something and I will be happy to add it to my list.

Summary

Well, I hope this post will help you to choose the best way of integrating Nginx and cPanel server. If you already used one of the methods above – please, leave a comment! Share your experience!

External links

  1. http://en.wikipedia.org/wiki/Nginx
  2. http://wiki.nginx.org/Main
  3. http://www.hostmedic.com/admin/network_administration/nginx-apache-happy-fast-cpanel-server/
  4. http://cpnginx.com/
  5. http://syslint.com/cPnginx
  6. http://www.setupnginx.com/
  7. http://www.remsys.com/products
  8. http://nginxcp.com/

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>