How To Configure Your Server to Log Real Visitor IPs
Because CloudFlare acts as a proxy, all visits to your website and web applications will, by default, be logged as originating from a CloudFlare IP address — not the visitor’s actual IP address. However, the Apache module mod_cloudflare can be used to ensure that visitors’ actual IP addresses are logged and displayed. We recommend that you activate mod_cloudflare as outlined in this article to accurately log website visitor IP addresses and prevent unwanted behavior. Without this step, your server’s firewall could block CloudFlare’s IP addresses, making your site inaccessible. If you need to check whether the module is already enabled or need assistance installing it, please open a ticket and Heroic Support® will be happy to help.
Pre-Flight Check
- This article assumes that you have already set up CloudFlare and added your domain.
- We’ll be installing the mod_cloudflare module for Apache, and you’ll need root-level SSH access to proceed.
- If you’re using a web server other than Apache, you’ll need to enable the appropriate module for your web server. For Nginx, you can use the ng_http_realip_module, and an HTTP Module for IIS also is available.
Installing mod_cloudflare on CentOS 6 and CentOS 7 Servers with cPanel
To install mod_cloudflare on a cPanel server running CentOS 6 or CentOS 7, simply yum install our mod_cloudflare package: yum install lw-mod_cloudflare-cpanel
We built the RPM in a way that does not require you to run EasyApache, because Heroic Support® is what we do 🙂 To confirm that the module has been added to Apache, run this command: httpd -M | grep -i cloud
Installing mod_cloudflare on Core-Managed CentOS 6 and CentOS 7
To install mod_cloudflare on a core managed (non-cPanel) server running CentOS 6 or 7, simply yum install our mod_cloudflare package! yum install lw-mod_cloudflare
To confirm that the module has been added to Apache, run this command: httpd -M | grep -i cloud
Installing mod_cloudflare on Ubuntu/Debian Core-Managed Servers
To install mod_cloudflare on Ubuntu/Debian Core Managed, simply apt-get install our mod_cloudflare package: apt-get install lw-mod_cloudflare
To confirm that the module has been added to Apache, run this command: httpd -M | grep -i cloud
Next Step: Get to Know CloudFlare
Now that you’ve got everything configured, it’s time to Explore the CloudFlare dashboard.
Related Articles:

About the Author: dpepper
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.
Latest Articles
2024 cPanel and Plesk pricing breakdown
Read ArticleCentOS Linux 7 EOL — everything you need to know
Read ArticleHow to install Node.js on Linux (AlmaLinux)
Read ArticleUpgrading or installing PHP on Ubuntu — PHP 7.2 and Ubuntu 22.04
Read ArticleWhy is your IP blocked?
Read Article