The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    18
    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.
     
  2. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    18
    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...
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,776
    Likes Received:
    663
    Trophy Points:
    113
    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.
     
Loading...

Share This Page