How to install mod_cloudflare for easyapache 4 How to install mod_cloudflare for easyapache 4 apache apache

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?

  1. We're using the cPanel installer.sh as suggested by Cloudflare but the compiled mod_cloudflare.so throws an error if you then run service httpd restart. Lets fix this.
  2. Download the source mod_cloudflare file.
  3. Ensure we have the correct EasyApache4 developer tools to build the mod_cloudflare module.
  4. Build and install extension module.
  5. Remove the new mod_cloudfare.conf file since we prefer the one that was generated and installed in step 1.
  6. 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.