How to install mod_cloudflare for easyapache 4
Figured I'd throw my solution into the mix using Centos 6.9 with WHM/cPanel.
bash <(curl -s https://raw.githubusercontent.com/cloudflare/mod_cloudflare/master/EasyApache/installer.sh)wget https://raw.githubusercontent.com/cloudflare/mod_cloudflare/master/mod_cloudflare.cyum install ea-apache24-develapxs -a -i -c mod_cloudflare.crm /etc/apache2/conf.modules.d/mod_cloudflare.confservice httpd restart
What's happening?
- We're using the cPanel
installer.sh
as suggested by Cloudflare but the compiledmod_cloudflare.so
throws an error if you then runservice httpd restart
. Lets fix this. - Download the source
mod_cloudflare
file. - Ensure we have the correct EasyApache4 developer tools to build the
mod_cloudflare
module. - Build and install extension module.
- Remove the new
mod_cloudfare.conf
file since we prefer the one that was generated and installed in step 1. - Restart apache.
Note: The mod_cloudflare
module will not show in EasyApache4. You can see it's enabled by running httpd -M | grep cloudflare
and you should see something like cloudflare_module (shared)
.
References:
I found a solution that worked perfectly.
This github project installs the module and adds it into EasyApache so that future rebuilds keep the module active. This was the only solution I found that actually works for EasyApache 4. Everything else seems to be for EasyApache 3.
CloudFlare was not much help with this either, as they had suggested I contact my hosting provider for assistance.
I know this is a bit old now, but it's the first answer that shows up in google.
The official cloudflare answer does work, it just doesn't show up in the EA4 list of modules. However it is installed and working.