Get real IP-address in Apache log CentOS

Are you using CloudFlare? Then you might have the issue that Apache registers the IP-address of the CloudFlare hosting platform instead of the IP-address of the visitor.

In that case you have to enable the mod_cloudflare Apache module. You can do this by running:

yum -y install libtool httpd-devel
cd /root/
git clone https://github.com/cloudflare/mod_cloudflare.git && cd mod_cloudflare
apxs -a -i -c mod_cloudflare.c
chmod 755 /usr/lib64/httpd/modules/mod_cloudflare.so

service httpd restart && httpd -M|grep cloudflare

Redirecting to /bin/systemctl restart httpd.service
 cloudflare_module (shared)
Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp