Install mod_cloudflare on CWP Apache Web Server

by Sandy

mod_cloudflare Apache module will restore the remote ip and it will also fix https issue with Cloudflare flexible ssl.

Based on mod_remoteip.c, this Apache extension will replace the remote_ip variable in user’s logs with the correct remote IP sent from CloudFlare. The module only performs the IP substitution for requests originating from CloudFlare IPs by default.

In addition to this, the extension will also set the HTTPS environment variable to “on” in cases where Flexible SSL is in use. This prevents software such as WordPress from being broken by Flexible SSL.

To install,  Follow this steps :

Step one install required dependencies :

yum install libtool git -y

Download C Lone cloudflare Apache module from git :

cd /usr/local/src
git clone && cd mod_cloudflare

Install Mod_cloudflare :

/usr/local/apache/bin/apxs -a -i -c mod_cloudflare.c

Restart apache service and check the module installed or not :

service httpd restart && /usr/local/apache/bin/httpd -M|grep cloudflare

eg. output :

[root@srv mod_cloudflare]# service httpd restart && /usr/local/apache/bin/httpd -M|grep cloudflare
Redirecting to /bin/systemctl restart httpd.service
 cloudflare_module (shared)

If this post helps you in any way please consider a donation

Donate with PayPal :


Donate with Paytm :


You may also like

Leave a Reply

1 Comment threads
3 Thread replies
Most reacted comment
Hottest comment thread
2 Comment authors
TnowSandy Recent comment authors
newest oldest most voted
Notify of