Are you ready to give your cpanel servers a big performance boost? Then take a look at this tutorial, where we will guide you to install & configure Nginx on your cPanel server.
As you know, cPanel doesn’t have native support for Nginx yet, that’s why you are forced to use Apache web server, which is not the best webserver for your website and server performance. Luckly there are many ways to install nginx on cpanel, and on this tutorial we will let you know how to do it using Nginxcp installation script.
One of the good things of this configuration, is that you don’t need to change a single thing in your websites, as your code and .htaccess files are 100% compatibles. This is one of the easiest and fastest way to install Nginx on cPanel server.
This are some of the features of this wonderful script:
- Compatible with WHM: allows you to configure and analyze nginx logs with a GUI.
- Gzip compression: it is compatible with Gzip compression, which will allow you to get faster speeds.
- Integrated with the cPanel Service Monitor configuration
- You can choose which domains will use Apache and which will use Nginx as reverse proxy.
Installing Nginx on cPanel
Move to WHM > Cluster/Remote Access > Setup Remote Access Key and click at “Generate New Key button”
cd /usr/local/src wget http://nginxcp.com/latest/nginxadmin.tar tar xf nginxadmin.tar cd publicnginx ./nginxinstaller install /etc/init.d/httpd restart
All done, it should be installed.
The only thing you need is to test this out, we will use curl from the shell to see if the website headers are showing Nginx as web server:
[user@localhost ~]$ curl -I www.yoursite.com HTTP/1.1 200 OK Server: nginx Date: Thu, 21 Aug 2014 10:26:10 GMT Content-Type: text/html Connection: keep-alive Vary: Accept-Encoding,User-Agent [user@localhost ~]$
If you see Server: nginx in the headers, that means everything is working as expected.
If you ever need to tweak Nginx configuration, it can be easily done in this way:
nano -w /etc/nginx/nginx.conf
You will see a pretty well configured Nginx server, however it may not be the best for all machines and traffic, so, tweak as you need:
Then after you apply the changes, reload Nginx:
service nginx reload
By the way, all the virtual hosts files for your cPanel domains are hosted at /etc/nginx/vhosts
Popular search terms:
- nginx cpanel
- cpanel nginx
- nginx setup for php cpanel