Solved

Webalizer and apache log

Posted on 2003-10-28
3
504 Views
Last Modified: 2008-03-10
My apache log is very big, and I want to do log rotate. But, I think this will affect the webalizer result, it will not be accurate.

Anyone know what is the best way to solve this? Basically I dont want the apache log to be a very big files but I also want the webalizer to be able to create accurate output.

Please help,

Thanks.
0
Comment
Question by:nova2002
  • 2
3 Comments
 
LVL 8

Expert Comment

by:heskyttberg
Comment Utility
Hi!

Well how often do you run webalizer ?
When does webalizer run ?

I ran webalizer every hour.
I rotated logs once every week, keeping 4 weeks.

This gave us very good accuracy, I never experienced that we lost any info.
Let's say webalizer runs 0:00 at night, every hour.
The logrotate runs at the same time, but it's not only apache logs that needs rotating.
Webalizer only has to parse one hour of traffic.
It will most likely be done by the time logrotate comes to apache.

If you are really, really unlucky, you might loose 45-60 minutes of traffic between 23:0x and 24:0x.

But my experience is that I at most lost 1-3 minutes if any at all.
Thoose minutes are between 24:00-24:03

Regards
/Hasse
0
 

Author Comment

by:nova2002
Comment Utility
I came up with this solution:

* I edited "httpd" logrotate configuration in /etc/logrotate.d to be like this :

/home/www/mydomain.com/logs/*log {
    missingok
    notifempty
    sharedscripts
    prerotate
        /usr/bin/webalizer
    endscript
    postrotate
        /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
    endscript
}

* I set webalizer.conf to do incremental and the log file to be processed is :

   /home/www/mydomain.com/logs/apache.log

* I removed 00Webalizer from /etc/cron.daily , because webalizer will be executed by logrotate process.

My scenario is : When the logrotate process occured, it will run webalizer and then rotate the log.

Is this a good solution? Or is it wrong?

I am not an experience linux admin btw.

Please if you can verify my solution :)

Thank you
0
 
LVL 8

Accepted Solution

by:
heskyttberg earned 40 total points
Comment Utility

That is a very good solution, you may still loose a few minutes.

But that shouldn't matter much.

I just did a webalizer each hour and logrotate each week, I didn't seem to loose any traffic at all.

Regards
/Hasse
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now