UserPreferences

ApplicationNotes/IspManLogStats


1. ISPMan Log Stats

This page describes the way I set up logging for one of my ISPMan installations.

  1. I use [WWW]Analog for web log analysis.

  2. I prefer to log all virtual hosts into one file. This keeps log rotation simple and limits the number of file descriptors Apache needs. The downside, of course, is that the log files can grow quite large even with only a few hundred domains, so the actual log analysis can run somewhat slowly. I use the vcommon log format, which is defined globally in httpd.conf, as recommended by the Analog documentation:

        LogFormat "%V %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vcommon
    

  3. I changed the vhost.conf.template like this:

        CustomLog       /var/log/httpd/virtual_log vcommon
        Alias /stats /var/www/stats/<perl>$servername</perl>
    

  4. I wrote a script the runs nightly out of cron like so:

    analog="/usr/bin/analog"
    
    for dom in $(/opt/ispman/bin/ispman.showdomains); do
            for vhost in $(/opt/ispman/bin/ispman.listvhosts -d $dom) ; do
                    if [ ! -d /var/www/stats/$vhost ]; then
                            mkdir /var/www/stats/$vhost
                    fi
                    ${analog} +C"HOSTNAME $vhost" +C"HOSTURL http://$vhost" +C"OUTFILE /var/www/stats/$vhost/index.html" \
                            +C"CONFIGFILE /var/www/etc/analog/global-bulk.cfg" +C"VHOSTINCLUDE $vhost"
            done
    done
    

Back to IspManNotes