Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»General Articles»How To Install mod_cloudflare for Apache on Ubuntu

    How To Install mod_cloudflare for Apache on Ubuntu

    By RahulAugust 25, 20222 Mins Read

    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.

    Advertisement

    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.

    Apache cloudflare
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    What is Media Access Control (MAC) Address?

    SQL Queries to Change Domain Name for WordPress Site

    How To Block Specific Keywords Using Squid Proxy Server

    View 7 Comments

    7 Comments

    1. PJO on March 15, 2021 11:26 am

      To save anyone else the time: 20.04 package is available now but not for ARM64 platform (Raspberry Pi).

      Reply
    2. karan on January 15, 2021 7:32 am

      not working…site not opening 502 gateway

      Reply
    3. Mat Gilbert on May 27, 2020 6:40 pm

      This did not work.

      Reply
      • Rahul on May 28, 2020 4:21 am

        Hi Mat,

        What issue are you facing?

        Reply
        • Rahul D. on September 30, 2020 10:04 am

          I guess you would need to update the instructions for Ubuntu 20.04

          Here is the error which might help you to debug:
          https://share.supremeopti.com/2020-09-30_15h32_34.jpg

          Reply
          • Rahul on October 4, 2020 3:34 am

            Hi Rahul, It looks cloudflare has not build package for Ubuntu 20.04 yet. We have to wait for it.

            Reply
    4. Adam on September 10, 2019 8:42 am

      Very helpful post. Thanks for sharing with us.

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Setting and Getting the Default Timezone in Python
    • What is Media Access Control (MAC) Address?
    • What is Cross-Site Scripting (XSS)?
    • What is Content Security Policy (CSP)?
    • A User’s Guide to Understanding Redirection Operators in Bash
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.