Web Hosting Talk







View Full Version : Receipt to 'fix' webalizer on R3&4


Félix C.Courtemanche
05-14-2001, 01:36 AM
Both implies that you are logged in your shell and are as root.

On Raq3:
edit /etc/cron.daily/webalizer.pl
find and modify this line:
webalizer -n $asite -s $asite -r $asite -Q -T -o $thepath $prefix/$asite/logs/web.log

to

webalizer -p -n $asite -s $asite -r $asite -Q -T -o $thepath $prefix/$asite/logs/web.log



On RAQ4:
edit /usr/local/bin/webalizer.pl
find and modify this line:
system("/usr/bin/webalizer -Q -D /var/cache/dns.cache -r $domains[$i] -n $domains[$i] -o $out $in");

to

system("/usr/bin/webalizer -Q -p -D /var/cache/dns.cache -r $domains[$i] -n $domains[$i] -o $out $in");


This will add persistence to your logs, thus they will not be overwritten everytimes your logs rotate. Of course, if a site has so much traffic that its logs are rotated before webalizer analyze them, there is only a solution:

On Raq3:
edit /etc/logrotate.d/apache
and add:
/usr/local/bin/webalizer.pl
after the line:
/bin/kill -USR1 `cat /var/run/httpd.pid`

You must then move
/etc/cron.daily/webalizer.pl to /usr/local/bin/webalizer.pl


On RAQ4:

edit /etc/logrotate.d/apache
and add:
/usr/local/bin/webalizer.pl
after the line:
/usr/bin/killall -HUP httpd 2> /dev/null || true

You must then move /etc/cron.d/webalizer somewhere else (/tmp/webalizer).


This last fix has the effect of running webalizer right after apache has rotated its log but right before the other logs are rotated (i.e the sites logs).

PLEASE NOTE THAT THIS IS AN UNSUPPORTED HACK. Cobalt will NOT like the fact that you play with their configuration files and it may very well void your guarantee.

Anyhow... have fun :)