Replacement for mod_cloudflare

AppleAndMango

Active member
Cloudflare is no longer going to support or update their mod_cloudflare module for Apache, anyone know of what the replacement would be? I understand there's a line I can add to my Xenforo config but I would prefer to see real ip addresses in my apache logs.


Any ideas?
 
They're specifically not maintaining their OS packages RPM/DEB. The Apache module itself is still being maintained.

Are you by chance on CentOS/cPanel? If so I have an RPM I can send you. We maintain Cent 6/7 RPMs for mod_cloudflare for our customers.
 
Oh. So basically I would have to regularly rebuild the module to keep it updated?

I'm not sorry, just a generic-ish LAMP thanks for the offer though.
 
Oh. So basically I would have to regularly rebuild the module to keep it updated?

I'm not sorry, just a generic-ish LAMP thanks for the offer though.

Yep, it doesn't update often though. I don't think it's changed in several years at this point.

Unless some major bug or vulnerabilities is found it should just keep on keeping on as long as Apache is on 2.4.x.

If you want to shoot me a PM I can help you build it and set it up manually on your server if you need.
 
Yeah I saw their github page and noticed the same...

Oh no it's fine, I'm just in the process of rebuilding a server because of changing providers and noticed they were no longer supporting it thanks for the offer though.
 
It took me a while to figure out how to properly configure mod_remoteip with cpanel. In case anyone else is struggling with this, here's what worked for me:

First, install mod_remoteip in EasyApache

Then, go into Include Editor within Apache Configuration in WHM

Within Include Editor, edit "pre_virtualhost_global.conf" (Pre Virtualhost)

Add the following lines:

RemoteIPHeader CF-Connecting-IP
RemoteIPTrustedProxy 103.21.244.0/22
RemoteIPTrustedProxy 103.22.200.0/22
RemoteIPTrustedProxy 103.31.4.0/22
RemoteIPTrustedProxy 104.16.0.0/12
RemoteIPTrustedProxy 108.162.192.0/18
RemoteIPTrustedProxy 131.0.72.0/22
RemoteIPTrustedProxy 141.101.64.0/18
RemoteIPTrustedProxy 162.158.0.0/15
RemoteIPTrustedProxy 172.64.0.0/13
RemoteIPTrustedProxy 173.245.48.0/20
RemoteIPTrustedProxy 188.114.96.0/20
RemoteIPTrustedProxy 190.93.240.0/20
RemoteIPTrustedProxy 197.234.240.0/22
RemoteIPTrustedProxy 198.41.128.0/17
RemoteIPTrustedProxy 2400:cb00::/32
RemoteIPTrustedProxy 2405:b500::/32
RemoteIPTrustedProxy 2606:4700::/32
RemoteIPTrustedProxy 2803:f800::/32
RemoteIPTrustedProxy 2c0f:f248::/32
RemoteIPTrustedProxy 2a06:98c0::/29
LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined

Then restart apache.

Double-check latest list of cloudflare ip addresses here:

https://www.cloudflare.com/ips/

See:

https://forums.cpanel.net/threads/remoteip-and-proxy-server-config.625751/#post-2542539

https://forums.cpanel.net/threads/configure-mod_remoteip-for-cloudflare.640101/

https://community.cloudflare.com/t/all-guests-have-the-same-ip/58704

https://forums.cpanel.net/threads/visitor-ips-in-logs-using-cloudflare.594027/
 
It took me a while to figure out how to properly configure mod_remoteip with cpanel. In case anyone else is struggling with this, here's what worked for me:

First, install mod_remoteip in EasyApache

Then, go into Include Editor within Apache Configuration in WHM

Within Include Editor, edit "pre_virtualhost_global.conf" (Pre Virtualhost)

Add the following lines:



Then restart apache.

Double-check latest list of cloudflare ip addresses here:

https://www.cloudflare.com/ips/

See:

https://forums.cpanel.net/threads/remoteip-and-proxy-server-config.625751/#post-2542539

https://forums.cpanel.net/threads/configure-mod_remoteip-for-cloudflare.640101/

https://community.cloudflare.com/t/all-guests-have-the-same-ip/58704

https://forums.cpanel.net/threads/visitor-ips-in-logs-using-cloudflare.594027/
This works ok, but i see impact one performance Apache/php-fpm the cpu goes more high fore same demand.
 
Top Bottom