[ Linux - CentOS - Apache 2.2 - mod_cloudflare - apxs2 ]
I have changed my nameservers to point to CloudFlare. The problem is that all the IP addresses are coming in as CloudFlare's. This is no good, because I have to monitor and block some specific traffic. mod_cloudflare is supposed to resolve this but I have been unable to get this installed. The command in the documentation uses apxs2. I can't figure out how to install this, or if it just means for 'apache 2.4'. I'm running 2.2.3, and I can use 'apxs'.
When I run:
apxs -aic mod_cloudflare.c
I get the error
apxs:Error: Command failed with rc=65536
Does this mean I need apxs2 or something else? How do I get mod_cloudflare working on my server?
I appreciate any help, the documentation is vague and limited.
Fetch the RPM for your platform from https://www.cloudflare.com/resources-downloads: https://github.com/downloads/cloudflare/mod_cloudflare/mod_cloudflare-1.1.1-1.i586.rpm (32bit) and https://github.com/downloads/cloudflare/mod_cloudflare/mod_cloudflare-1.1.1-1.x86_64.rpm (64bit)
rpm -ivh mod_cloudflare-1.1.1-1.*
LoadModule cloudflare_module /usr/lib64/apache2/mod_cloudflare.so <IfModule mod_cloudflare.c> CloudFlareRemoteIPHeader CF-Connecting-IP CloudFlareRemoteIPTrustedProxy 188.8.131.52/24 184.108.40.206/24 220.127.116.11/21 18.104.22.168/20 22.214.171.124/22 126.96.36.199/18 188.8.131.52/18 #DenyAllButCloudFlare </IfModule>
On 32bit change
A bit late to the party, but I received the error:
libtool: install: cp .libs/mod_cloudflare.so /usr/lib64/httpd/modules/mod_cloudflare.so cp: cannot create regular file '/usr/lib64/httpd/modules/mod_cloudflare.so': Permission denied apxs:Error: Command failed with rc=65536
And the reason, as stated in the error, is due to
I was able to execute the command with
sudo apxs -a -i -c mod_cloudflare.c