Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

CloudFlare User True IP Easy Apache 4 CentOS 7 /cPanel 78

Discussion in 'EasyApache' started by Kilberz, Mar 27, 2019.

Tags:
  1. Kilberz

    Kilberz Registered

    Joined:
    Mar 27, 2019
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United Kingdom
    cPanel Access Level:
    Root Administrator
    Hi Everyone,

    Please go easy, I've searched and found many conflicting posts on this and lots of them I found are no longer working solutions.

    I'm trying to find a way to easily configure the server (cPanel 78 / CentOS 7) so that any site hosted be it behind CloudFlare or not will always reflect the users true IP.

    I installed ea-apache24-devel then https://www.cloudflare.com/static/misc/mod_cloudflare/mod_cloudflare.c and ran apxs -a -i -c mod_cloudflare.c

    This seemed like a working solution for some but has not given me what I need to the best of my knowledge / as far as I can see still got an internal 192.* IP.

    Any help would be awesome, thank you.

    Jason.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello Jason,

    You can revert the initial steps you took and instead install mod_remoteip with EasyApache 4 using the following command:

    Code:
    yum install ea-apache24-mod_remoteip
    Once you do this, there's a post on the link below with an example of how to configure it to log the IP address of the visitor instead of the CloudFlare IP:

    mod_cloudflare vs mod_remoteip

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Kilberz

    Kilberz Registered

    Joined:
    Mar 27, 2019
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United Kingdom
    cPanel Access Level:
    Root Administrator
    Thank you for the response!

    How would I revert my prior actions?
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    You can remove the module from the /usr/lib64/apache2/modules/ directory, remove mod_cloudflare.conf, and then restart Apache. Here's an example:

    Code:
    # mkdir /root/cloudflare
    # mv /usr/lib64/apache2/modules/mod_cloudflare.so /root/cloudflare/
    # mv /etc/apache2/conf.modules.d/mod_cloudflare.conf /root/cloudflare/
    # /scripts/restartsrv_httpd
    Keep in mind this is untested because it's a custom module.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice