OS-X 'site' webserver logs?

Discussion in 'macOS' started by Danksi, Nov 21, 2005.

  1. Danksi macrumors 68000

    Danksi

    Joined:
    Oct 3, 2005
    Location:
    Nelson, BC. Canada
    #1
    I'm using my iMac's site folder/apache functionality for video file downloads that are too big for my webhosting.

    I was wondering whether or not there were any logs that would allow me to see who's downloaded files, when, how many bytes etc..?
     
  2. tag macrumors 6502a

    tag

    Joined:
    Apr 29, 2005
    Location:
    PA, US
    #2

    Yes all activity should be logged by default. The logs can be found via terminal or Console at '/var/log/httpd/'. In that directory there is 'access_log' which shows access info, and the 'error_log' which shows errors/notices that apache encounters.

    For a brief rundown on the access_log (which is what you will be using for what you want to find out) here is an example

    Code:
    127.0.0.1 - - [21/Nov/2005:14:38:33 -0500] "GET /apache_pb.gif HTTP/1.1" 200 2326
    127.0.0.1 - - [21/Nov/2005:14:38:34 -0500] "GET /favicon.ico HTTP/1.1" 404 289
    The first part is the IP address of who accessed your site
    The second part obviously is the date ;)
    Third part in quotes tells of the request string 'ie GET, POST ...'
    Fourth part (the first set of numbers) is the Response by your server (200 means success, 404 means not successful in retrieving data)
    Fifth part (second set of numbers) is the file size of the response ( so say someone downloaded a video from you, this would be alot of bytes)(ie. 234234234)

    If you need more info than this or some programs that can automate the process of checking logs, here is a nice little snippet from a guide all about Apache...

    http://www.samspublishing.com/library/content.asp?b=Mac_OS_X_Unleashed&seqNum=211&rl=1
     
  3. Danksi thread starter macrumors 68000

    Danksi

    Joined:
    Oct 3, 2005
    Location:
    Nelson, BC. Canada
    #3
    Thanks!

    I'll check this out when I get back home this evening - will be the first time using the OSX terminal (oooh!) :)
     

Share This Page