
|
View Full Version : rotating logs problem
Surfer 05-24-2001, 05:46 AM Hi,
I have a RAQ4 with webalizer installed.
My problem is that whenever the raq decides to rotate the logs it does it before my webalizer has calculated the last day, which results in that I loose stats for one day.
I have set the cron for webalizer to work at 4am, but I guess that the raq rotates the log around midnight and then leaves an empty log for webalizer...
What should I do?
When does exactly the raq rotate the logs?
Also, it seems to create a file called web.log.1.gz, but never a web.log.2.gz. Does it erase the old web.log.1.gz when it rotates?
My other less intensive sites don't experience this problem...
thanks
Chicken 05-25-2001, 12:54 AM Well, I moved webalizer.pl out of cron.daily and tried to run it after the logs split, but it still didn't seem to work. basically, it sounds like the logs are reaching a certain size and then rotating, then webalizer tries to read the logs. Like I said, I was unsu7ccessful at solving this problem with one of my busy sites and it still doesn't work right.
jnestor 05-25-2001, 11:20 AM Chicken - where did you move it to? I moved my call to webalizer to the apache file in /etc/logrotate.d right after the call to split_logs. Works fine for me.
Surfer that seems to be the method that works.
Move webalizer.pl out of cron.daily
Add a call to webalizer.pl to the access section of the file /etc/logrotate.d/apache after split_logs.
Be sure to turn on incremental processing in /etc/webalizer.conf (or in webalizer.pl itself).
-Edward- 05-25-2001, 11:24 AM If your site transfers over a gigabyte a day webalizer wont be able to handle it.... Howvere i find the cobalt stats for the site very accurate weird huh?
One of the domains located on my server recieve so many hits a day that the /stats/ folder is empty.. I assume this is because webalizer gets too big to update it for that site.. the question is.. turning incremental processing on will fix that error?
Thanks...
Chicken 05-26-2001, 12:56 AM Originally posted by jnestor
Chicken - where did you move it to? I moved my call to webalizer to the apache file in /etc/logrotate.d right after the call to split_logs. Works fine for me.
Surfer that seems to be the method that works.
Move webalizer.pl out of cron.daily
Add a call to webalizer.pl to the access section of the file /etc/logrotate.d/apache after split_logs.
Be sure to turn on incremental processing in /etc/webalizer.conf (or in webalizer.pl itself).
I just moved it to a folder (forgot where), and did all that, incremental processing too. I don't know what the heck is up with it and might remove the current one and try installing the one on the http://pkg.nl.cobalt.com site. I really can't figure out why it still doesn't work.
Robert, it isn't that webalizer gets too big, it is that the lo0g file gets too big and then rotates out, webalizer goes to read it and there ain't nothing there, so it never creates a webalizer log file (stats dir remains empty). Webalizer seems to work really well with smaller sites and has problems with the bigger ones.
Maybe a reinstall will fix my problem, i don't know... I'm a bit baffled at this point.
Have any of you tried this?
It worked for me.. except webalizer can't update for the big sites.. as Chicken explained to me "Robert, it isn't that webalizer gets too big, it is that the lo0g file gets too big and then rotates out, webalizer goes to read it and there ain't nothing there, so it never creates a webalizer log file (stats dir remains empty). Webalizer seems to work really well with smaller sites and has problems with the bigger ones. " (Thanks Chicken)
Posted by Felix a while back:
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
Chicken 05-26-2001, 06:13 PM Well I've tried combinations of these things, but I think I'll uninstall it and reinstall it fresh and try all that... *has high hopes*
Félix C.Courtemanche 05-26-2001, 07:18 PM FYI, when the information above is applied correctly, all sites logs get webanalyzed before rotated. Thus any sites, with a million hits or only 10 will get accurate reports.
I've tested it on our RAQ3 & 4 and it always works fine.
:)
Félix C.Courtemanche 05-26-2001, 07:23 PM Originally posted by Technics
If your site transfers over a gigabyte a day webalizer wont be able to handle it.... Howvere i find the cobalt stats for the site very accurate weird huh?
Thats because when Cobalt's stats are made, it is right after the main Apache file is splitted into sites logs, but right before sites logs are rotated. This is why I suggested my little trick.
WreckRman2 05-26-2001, 07:54 PM I have Webasucker and it does just that, sucks... It has never worked right and i cant even uninstall it as it wont let me.. even as root and using uninstall program. cant update to 2.0 without the uninstall, etc..
worthless to me but i do over 2 gig a day transfer.. any other programs?
|