As you know, using cloudflare is a method to hide the A record of the domain and it has many advantages like preventing DDOS as well as providing CDN and so on.
But if you enable cloudflare for a domain you wont be able to find the original client IPs accessing the website in cPanel vistor page or in the domlogs of the particular domain.
Fix
For that we need to enable “remoteip_module” by running easyapache.
After that you need to provided lines in the “/etc/apache2/conf.d/includes/pre_main_global.conf” file.
<IfModule remoteip_module>
RemoteIPHeader X-Forwarded-For
</IfModule>
<IfModule log_config_module>
LogFormat “%{Referer}i -> %U” referer
LogFormat “%{User-agent}i” agent
LogFormat “%a %l %u %t \”%r\” %>s %b” common
LogFormat “%a %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”” combined
CustomLog logs/access_log combined
Rebuild and restart the apache service.
Now you can see the original IPs accessing the domains from cPanel visitor as well as from the apache domlogs.
That’s it!