How to install EasyApache 4 CloudFlare module for cPanel

If you use cloudflare for your websites, sometimes you would have noticed cloudflare IP being logged in web server logs instead of the visitors IP’s. The reason behind this issue is that the cloudflare acts as a reverse proxy for your websites hence instead of recording your visitors IP cloudflare’s IP’s are displayed in your web server logs and web applications. To resolve this problem, we need to install mod_cloudflare for apache.

Let’s discuss how we can install mod_cloudflare on cPanel servers running EasyaApache 4 web stacks. As we know, all modules can be installed using yum in EA4 web stack, we can search whether mod_cloudflare is available.

[root@server ~]# yum search ea-apache24-mod_cloudflare
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
 * EA4: 104.219.172.10
 * cpanel-addons-production-feed: 104.219.172.10
 * base: mirror.softaculous.com
 * epel: mirror.sjc02.svwh.net
 * extras: mirror.tobias-wollmann.com
 * updates: ftp.hosteurope.de
No Matches found
[root@server ~]#

Above result shows, it’s not available. We need to enable some extra yum repo in the server.

For CentOS-6:

# cd /etc/yum.repos.d/
# wget http://download.opensuse.org/repositories/home:Jperkster:EA4_Mod_Cloudflare/CentOS-6/home:Jperkster:EA4_Mod_Cloudflare.repo

For CentOS-7:

# cd /etc/yum.repos.d/
# wget http://download.opensuse.org/repositories/home:Jperkster:EA4_Mod_Cloudflare/CentOS-7/home:Jperkster:EA4_Mod_Cloudflare.repo

Now search whether the module is available to install.

[root@server yum.repos.d]# yum search ea-apache24-mod_cloudflare

Sample Output

Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
 * EA4: 104.219.172.10
 * cpanel-addons-production-feed: 104.219.172.10
 * base: mirror.eu.oneandone.net
 * epel: linux.mirrors.es.net
 * extras: mirror.eu.oneandone.net
 * updates: ftp.hosteurope.de
home_Jperkster_EA4_Mod_Cloudflare | 1.3 kB 00:00
home_Jperkster_EA4_Mod_Cloudflare/primary | 1.5 kB 00:00
home_Jperkster_EA4_Mod_Cloudflare 5/5
============= N/S Matched: ea-apache24-mod_cloudflare =====================
ea-apache24-mod_cloudflare-debuginfo.i686 : Debug information for package ea-apache24-mod_cloudflare
ea-apache24-mod_cloudflare-debuginfo.x86_64 : Debug information for package ea-apache24-mod_cloudflare
ea-apache24-mod_cloudflare.i686 : CloudFlare Apcahe module mod_cloudflare to show visitor IPs in logs.
ea-apache24-mod_cloudflare.x86_64 : CloudFlare Apcahe module mod_cloudflare to show visitor IPs in logs.

Yep, the package is available now. Before we go ahead and install mod cloudflare we will check server architecture as both 32-bit & 64-bit packages are available.

[root@server ~]# arch
x86_64
[root@server ~]#

We need to install 64-bit package.

[root@server ~]# yum install ea-apache24-mod_cloudflare.x86_64

Sample Output

Loaded plugins: fastestmirror, universal-hooks
Setting up Install Process
Loading mirror speeds from cached hostfile
 * EA4: 104.219.172.10
 * cpanel-addons-production-feed: 104.219.172.10
 * base: mirror.softaculous.com
 * epel: linux.mirrors.es.net
 * extras: mirror.tobias-wollmann.com
 * updates: centos.mirrors.psw.services
Resolving Dependencies
--> Running transaction check
---> Package ea-apache24-mod_cloudflare.x86_64 0:1.2.0-.5.17 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================
 Package Arch Version Repository Size
======================================================================================================
Installing:
 ea-apache24-mod_cloudflare x86_64 1.2.0-.5.17 home_Jperkster_EA4_Mod_Cloudflare 9.1 k

Transaction Summary
======================================================================================================
Install 1 Package(s)

Total download size: 9.1 k
Installed size: 19 k
Is this ok [y/N]: y

httpd started successfully.
Setting /home permissions to 0711......Done
Verifying : ea-apache24-mod_cloudflare-1.2.0-.5.17.x86_64 1/1Installed:
 ea-apache24-mod_cloudflare.x86_64 0:1.2.0-.5.17

Complete!

If you want to remove this module, you can use following command.

# yum remove ea-apache24-mod_cloudflare.x86_64

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge