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!

Apache logs & reverse IP address lookup

Discussion in 'EasyApache' started by sehh, Apr 7, 2015.

  1. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    168
    Location:
    Europe
    Hello,

    A few days ago, I noticed that my apache logs had domain names instead of IP addresses, for example:

    Code:
    msnbot-157-55-39-11.search.msn.com - - [08/Apr/2015:01:07:39 +0100] "GET /file.html HTTP/1.1" 200 53540 "-" "Mozilla/5.0 (compat
    ible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
    
    How can I disable this feature and instead force it to log IP addresses only?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    168
    Location:
    Europe
    To answer my own problem:

    Apparently when the .htaccess contains a rule that performs a reverse DNS lookup, it forces the Apache logs to store the hostname instead of the IP address. Even if "HostnameLookups" is set to "Off" in the configuration.

    Bug or feature? who knows...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,740
    Likes Received:
    1,796
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    This is normal behavior with the default Apache configuration. You would have to disable AllowOverride for this VirtualHost to prevent the user from making that change in their .htaccess file.

    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