Set up Log Analysis Reports

Analog is a program with processes webserver access logs, performs DNS lookup, and outputs HTML reports. Analog should already be installed. A modified configuration file is included in the OpenACS tarball.

  1. [root src]# su - service0
    [service0 service0]$ cd /var/lib/aolserver/service0
    [service0 service0]$ cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/analog.cfg.txt etc/analog.cfg
    [service0 service0]$ mkdir www/log
    [service0 service0]$ cp -r /usr/share/analog-5.31/images www/log/
    [service0 service0]$ 
    su - service0
    cd /var/lib/aolserver/service0
    cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/analog.cfg.txt etc/analog.cfg
    mkdir www/log
    cp -r /usr/share/analog-5.31/images www/log/

    Edit /var/lib/aolserver/service0/etc/analog.cfg and change the variable in HOSTNAME "[my organisation]" to reflect your website title. If you don't want the traffic log to be publicly visible, change OUTFILE /var/lib/aolserver/service0/www/log/traffic.html to use a private directory.

  2. Run it.

    [service0 service0]$ /usr/share/analog-5.31/analog -G -g/var/lib/aolserver/service0/etc/analog.cfg
    /usr/share/analog-5.31/analog: analog version 5.31/Unix
    /usr/share/analog-5.31/analog: Warning F: Failed to open DNS input file
      /home/service0/dnscache: ignoring it
      (For help on all errors and warnings, see docs/errors.html)
    /usr/share/analog-5.31/analog: Warning R: Turning off empty Search Word Report
    [service0 service0]$

    Verify that it works by browing to http://yourserver.test:8000/log/traffic.html

  3. Automate this by creating a file in /etc/cron.daily.

    [service0 service0]$ exit
    logout
    
    [root root]# emacs /etc/cron.daily/analog

    Put this into the file:

    #!/bin/sh
    
    /usr/share/analog-5.31/analog -G -g/var/lib/aolserver/service0/etc/analog.cfg
    [root root]# chmod 755 /etc/cron.daily/analog

    Test it by running the script.

    [root root]# sh /etc/cron.daily/analog

    Browse to http://yourserver.test/log/traffic.html

View comments on this page at openacs.org