situkak

Q: LogFormat of access_log

Hi

I am using OS X 10.11.2 and Server 5.0.11.

My access_log in /var/log/apache2/ is always like "xxx  aa.bb.cc.dd - - [26/Oct/2015:12:30:39 +0900] "GET ..."

even I accessed the server(xxx) from other macs.  The xxx and IP are  the hostname and IP of the server, not of the macs.

The access host might be wrong.  I expect that the server and IP must be a hostname of macs and its IP.

LogFormat "%h....".

 

Thanks

Tac

iMac, OS X El Capitan (10.11.1)

Posted on Oct 29, 2015 12:46 AM

Close

Q: LogFormat of access_log

  • All replies
  • Helpful answers

  • by Camelot,

    Camelot Camelot Dec 1, 2015 1:39 AM in response to situkak
    Level 8 (47,285 points)
    Mac OS X
    Dec 1, 2015 1:39 AM in response to situkak

    It sounds like you have the apache caching proxy enabled - this used to be called the Performance Cache, but it may be different now. The proxy sits in front of Apache, intercepting incoming requests and only passing cache misses to Apache. Since Apache sees the connection from the proxy, which is running on the same box, the IP address it sees is the IP address of the server.

     

    There are a couple of ways of getting around it, and it's been a while since I've played with it, but the simplest may be to disable the proxy. It doesn't serve a huge purpose for most people. If you do want/need the cache then you need to adjust the logging to include the X-Forwarded-For headers instead of the client IP.

  • by situkak,

    situkak situkak Dec 1, 2015 2:49 PM in response to Camelot
    Level 1 (15 points)
    Dec 1, 2015 2:49 PM in response to Camelot

    Hi Camelot,

     

    Now I understand the cause, the proxy cache.

    I'll try  the X-Forwarded-For logging.


    Thanks

    Tac (OSX 10.11 + Server5.0.15)