Pages

Monday, June 17, 2013

How to Install mod_cloudflare on a cPanel Server

When using CloudFlare, all of the hits to your web server will come from a CloudFlare IP address. To retrieve the actual IP address from the visitor, you must install mod_cloudflare.

How to Install mod_cloudflare

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

Change directory to /usr/local/src :
cd /usr/local/src
Get the source code for mod_cloudflare:
wget --no-check-certificate https://raw.github.com/cloudflare/mod_cloudflare/master/mod_cloudflare.c
CloudFlare-Tools/master/mod_cloudflare.c
Use the Apache Extension Tool to build and install mod_cloudflare:
apxs -a -i -c mod_cloudflare.c
Restart the Apache HTTP daemon:
service httpd restart
Update the Apache configuration data files:
/usr/local/cpanel/bin/apache_conf_distiller --update
That’s it! From now on, Apache will log the visitors’ IP addresses instead of the CloudFlare IP’s.

No comments:

Post a Comment