Solved

Webalizer and apache log

Posted on 2003-10-28
3
512 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Expert Comment

by:heskyttberg
ID: 9640485
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
ID: 9640913
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
ID: 9648436

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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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