AWSTATs Setup for Apache Logs:

How to:

  • You need to change your apache conf first.
    Decide on daily, weekly or monthly files (daily logs are much easier in the long run, imho!).
  • httpd.conf
    If you open your httpd.conf /usr/local/blackboard/apps/httpd/conf/httpd.conf and grep for error_log you will find you have something like:
ErrorLog logs/error_log

and you want:

ErrorLog "| /opt/common/sbin/cronolog --symlink=/usr/local/blackboard/logs/apache/error.log usr/local/blackboard/logs/apache/error_log%Y/%m/%d"

where this line will create a directory like error_log/2006/08/16 for today in your xxx/logs directory, and it will create a symlink
called error.log that links to the current error log file.

  • access_log
    Then go down a few lines where you see your line for access_log which looks like: CustomLog logs/access_log combined

and you want it to be:

CustomLog "| ErrorLog "| /opt/common/sbin/cronolog --symlink=/usr/local/blackboard/logs/apache/access.log usr/local/blackboard/logs/apache/access_log/%Y/%m/%d" combined 

where again it creates a chronological directory tree under access_log
with a symlink to the current log called access.log.

  • CustomLog
    You will also want to change the following line in httpd.conf located in
    the same area:
CustomLog /usr/local/blackboard/logs/httpd/access_log common

to

CustomLog /usr/local/blackboard/logs/httpd/access_log combined

to enable the capture of browser, OS, referer and anything else you want to customize.

  • No labels