How to install mod_cloudflare in cPanel / WHM

CloudFlare functions as a proxy, you will see changes to the way that your website visitors’ IP details are shown both in your server records and web applications – especially that all accessibility seems to be coming from CloudFlare IP details.

You can modify this actions and log & show the real guest IP details by using mod_cloudflare.

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

Login to your server as root.

Change directory to /usr/local/src

cd /usr/local/src

Download core file using command:

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

Build and install mod_cloudflare by using Apache Extension Tool

apxs -a -i -c mod_cloudflare.c

Restart the Apache Server:

service httpd restart

Update the Apache configuration data:

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

From now on, Apache will log the visitors’ actual IP addresses.