When using Apache web server behind cloudflare, apache logs show cloudflare IP address instead of real visitor IP address. To show actual visitor IP address, you need to install mod_cloudflare apache module.
Before you can install the module, you need to install following requirments.
On Debian/Ubuntu server,
1 |
apt-get install apache2-dev libtool git |
Now install mod_cloudflare with
1 2 3 |
cd /usr/local/src git clone https://github.com/cloudflare/mod_cloudflare.git; cd mod_cloudflare apxs -a -i -c mod_cloudflare.c |
Restart apache web server with
1 |
service apache2 restart |
Verify mod_cloudflare apache module is loaded with
1 |
apachectl -M | grep cloudflare |