Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Webalizer and apache log

Posted on 2003-10-28
3
Medium Priority
?
518 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 160 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

719 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