Configuring Webalizer for VirtualHosts -------------------------------------- 2005-11-06 1. su - 2. cd /etc 3. mv webalizer.conf webalizer.old 4. mkdir webalizer 5. Copy the webalizer.old file into /etc/webalizer/ and for each domain, name them accordingly. a. cp webalizer.old webalizer/example1.com.conf b. cd webalizer c. cp example1.com.conf example2.net.conf d. cp example1.com.conf example3.org.conf 6. Edit each /etc/webalizer/*.conf file for each domain respectively. (see webalizer_sample.txt) NOTE: Make sure you setup access logs and usage directories for each VirtualHost (see Apache.txt) 7. vi /etc/httpd/conf.d/webalizer.conf Comment everything otherwise you'll have /usage aliased to only one of your virtualhosts. 8. To process all, use a simple shell script which you can later setup in cron.daily a. vi /etc/cron.daily/webalizer.sh (or edit 00webalizer and comment out everything and add what is below) ---file begin--- #!/bin/bash for i in /etc/webalizer/*.conf do webalizer -c $i done ---file end--- b. do chmod +x (makes it executable) c. touch /var/lib/webalizer/example1.com.hist (also example1.com_cache.db for each example*) **DO NOT Create .current files** For reasons I haven't found out, it wants .hist and .db to be touched, but does NOT want .current files to be touched, so don't create them! d. comment out all of /etc/httpd/cron.d/webalizer.conf e. /etc/cron.daily/webalizer.sh (runs the script for a test) 9. After testing your shell script, it's ready to go NOTE: If you add another VirtualHost, setup the respective access log and webalizer.conf files and they should be picked up automatically. NOTE: If you keep your apache config mostly default and keep your logs in /var/log/httpd/ then logrotate should handle your log rotation for you, see /etc/logrotate.d/httpd (thanks RW)