Search code examples
loggingwampintranet

Log which IPs visit WAMP intranet page?


I've got several reports on our intranet (WAMP) and have been asked to see which managers make use of those reports.

I can look up their IP addresses fairly easily, but need to know the best way of recording who visits each page and which page they visit.

I know that you can use the access.log to see an overview of who visits any page hosted by the server, but is it possible to create a specific log for a specific page?

Any pointers helpful!


Solution

  • I managed to work it out in the end and here's how.

    In httpd.conf I added a new log format which showed me the various bits I needed to know

    LogFormat "%h %t \"%{Referer}i\" \"%r\"" simple
    

    I then created a variable so that if someone went to that specific set of pages then it would get that variable and I could log that particular web page's traffic independently of the rest of the traffic.

    SetEnvIf Referer http://intranet-srv02/reports/hourly/ intranet_report
    

    Finally I created a second log using the log format I created and the variable

    CustomLog "logs/reportlog.log" simple env=intranet_report
    

    This then provided me with the log for internal IPs that visited these reports and I could then use the command prompt command nbtstat -a ip.ip.ip.ip to find the host name and then look up which user was on that host in our login logs.