#!/usr/bin/perl ## Locate each virtualhost entry and run webalizer in its directory ## Configure each line according to needs, remove the $CFGLOCK entry when ## you have. ## Leigh Morresi $CFG_FILE="/etc/httpd/conf/httpd.conf"; $WEBALIZER="/usr/local/bin/webalizer"; $AUTOLOGFILE="/var/log/auto-webalizer.log"; $CFGLOCK="yes"; ## There probably isnt much of interest past here. if ( $CFGLOCK) { die "Please configure me correctly, i will now die."; } logmessage ("auto-webalizer begin"); $inside=0; $sc=0; open (CFGFILE,$CFG_FILE) or die "Could not open config file, have you configured this correctly? $?"; while() { chomp $_; if ( /^\>$AUTOLOGFILE") or die "Could not open log file for appending to $AUTOLOGFILE."; $now_string = localtime; print AUTOLOGFILE "$now_string: $message\n"; close(AUTOLOGFILE); }