hi all
as part of the server complete overhaul, i'm now for the first time separating webalizer stats for my websites (virtualhosts)
as I havn't done this before perhaps i am doing it wrong so please let me know if thats the case
i've had to create a webalizer.conf for site A (this one) and in the conf file i have the options i want...
now the next bit is telling cron to run it, i already see there is a cron job in /etc/cron.daily/00webalizer so i edit it to point to the linux noob website location and tell it to look for those log files plus point it to the stats directory
it works, i now have stats for linux-noob.com only,
so, do I create a separate conf file for each site in turn and create a separate cron job for each ? why is there a 00 infront of this cron job ?
Quote:so, do I create a separate conf file for each site in turn and create a separate cron job for each ? why is there a 00 infront of this cron job ?
I would create a separate conf file and cronjob for each site, so that they're isolated from each other - changes made to one site config won't affect the other, for example. But that's just me; others have been known to consolidate similar jobs into one file.
The 00 bit is just to prioritise it within that directory, since the system cron runs each file in alphabetical order - eg: "bwstats.sh" will run after "apache2-update.conf" but after "delete-spam.pl".
If I call a script "0-runme" then it appears "higher" than anything beginning with "a".
fixed it !
you need separate cron jobs for each site you want stats for
plus that
cron job must point to a unique webalizer.conf file for that site,
Quote:#! /bin/bash# update access statistics for the web site
if [ -s /var/log/httpd/linux/access.log ]; then
exec /usr/bin/webalizer -Q -c /var/www/html/websites/linux/webalizer.conf
fi
the log files referenced in webalizer.conf must be for each unique site
Quote:LogFile /var/log/httpd/linux/access.log
OutputDir /var/www/html/websites/linux/stats
in addition i had to create some additional directories and edit the webalizer.conf file for each site separatly with some additional settings
make some new dirs for webalizer
[root@linux-noob]# mkdir /var/lib/webalizer/websites
[root@linux-noob]# mkdir /var/lib/webalizer/websites/windows
[root@linux-noob]# mkdir /var/lib/webalizer/websites/linux
[root@linux-noob]# vi webalizer.conf
[root@linux-noob]# sh /etc/cron.daily/01webalizer
verify the following paths are correct for separate logging in webalizer for
each website
so for linux-noob.com webalizer stats
Quote:HistoryName /var/lib/webalizer/websites/linux/webalizer.hist
IncrementalName /var/lib/webalizer/websites/linux/webalizer.current
DNSCache /var/lib/webalizer/websites/linux/dns_cache.db
and for windows-noob.com webalizer stats
Quote:HistoryName /var/lib/webalizer/websites/windows/webalizer.hist
IncrementalName /var/lib/webalizer/websites/windows/webalizer.current
DNSCache /var/lib/webalizer/websites/windows/dns_cache.db