cloudflare – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Thu, 25 Aug 2022 10:05:02 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 How To Install Apache mod_cloudflare on Debian https://tecadmin.net/install-apache-mod-cloudflare-on-debian/ https://tecadmin.net/install-apache-mod-cloudflare-on-debian/#comments Sun, 04 Oct 2020 04:46:32 +0000 https://tecadmin.net/?p=23045 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 [...]

The post How To Install Apache mod_cloudflare on Debian appeared first on TecAdmin.

]]>
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.

The post How To Install Apache mod_cloudflare on Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/install-apache-mod-cloudflare-on-debian/feed/ 1
How To Install mod_cloudflare for Apache on Ubuntu https://tecadmin.net/install-apache-cloudflare-on-ubuntu/ https://tecadmin.net/install-apache-cloudflare-on-ubuntu/#comments Mon, 12 Aug 2019 06:42:03 +0000 https://tecadmin.net/?p=18970 Cloudflare is a content delivery network service that acts as a reverse proxy. It is widely used by websites to serve content through Cloudflare’s global network. When the website traffic is routed through Cloudflare, the backend servers logged the Cloudflare IP address instead of the original visitor IP address. This tutorial will help you to [...]

The post How To Install mod_cloudflare for Apache on Ubuntu appeared first on TecAdmin.

]]>
Cloudflare is a content delivery network service that acts as a reverse proxy. It is widely used by websites to serve content through Cloudflare’s global network. When the website traffic is routed through Cloudflare, the backend servers logged the Cloudflare IP address instead of the original visitor IP address.

This tutorial will help you to enable Apache mod_cloudflare module on a Ubuntu system. Which will log the original visitor IP address to logs.

Install mod_cloudflare for Apache

Cloudflare provides an official module for the Apache server to capture real IP addresses. You need to enable the PPA of the Cloudflare module to your Ubuntu system.

  1. Firstly import the GPG key into your system:
    curl -C - https://pkg.cloudflare.com/pubkey.gpg | sudo apt-key add - 
    
  2. Then create the PPA file with the below command:
    echo "deb http://pkg.cloudflare.com/ `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/cloudflare.list 
    
  3. Next, update Apt cache and install the libapache2-mod-cloudflare package on your Ubuntu system.
    sudo apt update 
    sudo apt install libapache2-mod-cloudflare 
    
  4. Once the installation is completed, restart the Apache2 service and check the active modules using the following commands.
    sudo service apache2 restart 
    
  5. Then list all the modules from the Apache web server.
    sudo apache2ctl -M 
    

    How to Install CloudFlare Module in Apache

Conclusion

In this tutorial, you have learned to configure the Cloudflare module to Apache on the Ubuntu system.

The post How To Install mod_cloudflare for Apache on Ubuntu appeared first on TecAdmin.

]]>
https://tecadmin.net/install-apache-cloudflare-on-ubuntu/feed/ 7