• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How To Install Apache mod_cloudflare on Debian

Written by Rahul, Updated on October 4, 2020

Cloudflare is the most popular content delivery network service provider. Which also incudes DNS, DDoS protection and security for the websites. In action cloudflare act as reverse proxy server. Once the website traffic is routed with cloudflare network, the backend server don’t know the actual visitor ip. In result, you will see the cloudflare IP address in Apache logs.

Now the question is how to get the real visitor IP in logs, instead of cloudflare IP. To resolve this, cloudflare provides an Apache module to get real visitor ip and log them.

This tutorial will help you to enable Apache mod_cloudflare module on Debian system. Which will log real visitor IP address to Apache access logs.

Install Apache mod_cloudflare on Debian

The cloudflare provides an official module for the Apache server to capture real ip address. You need to enable the PPA of cloudflare module to your Ubuntu system.

Add GPG – Open a terminal and execute below commands to enable add gpg key to your system.

sudo apt install curl 
curl -C - https://pkg.cloudflare.com/pubkey.gpg | sudo apt-key add - 

Add PPA – Then add the cloudflare repository to your debian system

echo "deb http://pkg.cloudflare.com/ `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/cloudflare.list 

Install Package – Next, update Apt cache and install libapache2-mod-cloudflare package on your Ubuntu system.

sudo apt update 
sudo apt install libapache2-mod-cloudflare 

Press ‘Y’ for any confirmation asked during the installation.

Restart Apache

Once the installation completed, restart Apache2 service and check the active modules using the following commands.

sudo systemctl restart apache2 

That’s it. The Apache server will log real IP address of the visitor to the logs.

sudo apache2ctl -M 

Conclusion

In this tutorial, you have learned to install Apache cloudflare module on Debian Linux system.

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

1 Comment

  1. Avatar Manu Reply
    October 6, 2020 at 4:00 pm

    Thanks a lot

Leave a Reply Cancel reply

Popular Posts

  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
  • How To Install NVM on macOS with Homebrew 0
  • (Solved) apt-add-repository command not found – Ubuntu & Debian 0
  • How to Install .NET Core on Debian 10 0
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy