cPanel/WHM

How to install NginX on cPanel/WHM Server

NginX is one of the most popular choice open source Web server and a reverse proxy. For those who are not very familiar with Linux & have cPanel/WHM installed in your server or VPS here is the guide on how to install them.

The package comes with Nginx Admin plugins for cPanel. To install execute the following command through SSH client. You have to login as root.

cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
./nginxinstaller install

If you are installing Nginx Admin for the first time and there is Python Error while installing you have to execute the following command.

./pythonfix
./nginxinstaller install

If you want to uninstall Nginx Admin, execute the following commands.

cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
./nginxinstaller uninstall

How to Install mod_cloudflare on a cPanel Server

There are many advantages of using Cloudflare, mainly to increase website performance (CDN) and security.

However, when using Cloudflare, all hits to your website will come from Cloudflare IP addresses. In order to obtain visitors’ actual IP address, you must install mod_cloudflare.

Installing mod_cloudflare on a cPanel server is very easy. Just follow 6 steps as below. Please be reminded that this is only applicable if you are using Apache webserver.

1. Connect to your server through SSH and log in as root.

2. Change directory to /usr/local/src

cd /usr/local/src

3. Obtain mod_cloudflare source code

wget --no-check-certificate http://github.com/cloudflare/CloudFlare-Tools/raw/master/mod_cloudflare.c

4. Build and install mod_cloudflare by using Apache Extension Tool

apxs -a -i -c mod_cloudflare.c

5. Restart the Apache Server daemon

service httpd restart

6. Update the Apache configuration data

/usr/local/cpanel/bin/apache_conf_distiller --update

From now on, Apache will log the visitors’ actual IP address instead of the Cloudflare IP addresses.