How to install mod_cloudflare for easyapache 4
apache, centos7, cloudflare, cpanel, easyapache-4
Solution
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.c
yum install ea-apache24-devel
apxs -a -i -c mod_cloudflare.c
rm /etc/apache2/conf.modules.d/mod_cloudflare.conf
service httpd restart
What's happening?
- 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.
- 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:
- https://www.cloudflare.com/technical-resources/
- https://community.cloudflare.com/t/help-installing-mod-cloudflare/1747/12
- http://www.marathon-studios.com/blog/issues-installing-mod_cloudflare-on-centos-7/
- https://forums.cpanel.net/threads/install-httpd-devel.594631/#post-2405975
Problem
I am trying to install mod_cloudflare for Apache using easyapache 4 on cPanel Server. I am running CentOS 7.2. I have installed mod_cloudflare for EasyApache4 following the instructions under Option 2 here. After running the installer it said "Done. Please restart EasyApache 4". I then went into WHM -> EasyApache 4 and tried to find the server module, but it is not to be found. I clicked the "run system update" button and tried again, to no avail. Is there an easyapache service that needs to be restarted via the command line? I am not a hosting provider so I have not tried the Cloudflare plugin for CPanel. * Edit 4/9/2019 * Changing accepted answer to EasyCo's, as the original solution no longer works.