LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
Search this Thread
Old 02-23-2006, 10:12 AM   #1
graq
LQ Newbie
 
Registered: Feb 2006
Posts: 19

Rep: Reputation: 0
Question Webserver Log Rotation, Stats and Archiving.


Hi

This is my first post, I searched on 'log rotation', 'webalizer', 'cronolog' and got a mixture of forums - so apologies if this is the wrong place.

I am running Apache 2 on RH ES (no load balancing or clustering), running multiple virtual hosts (each with their own log files). I am rotating these log files weekly using Cronolog (%Y_<vitrtualhostname>_access.log.%W) and have setup Webalizer conf files for each of these.

How I was planning to do it was to use Cronolog's -S and -P switches to have a '.thisweek' and '.lastweek' access files with Webalizer's config set to read .lastweek. I can then archive older log files later in the week.

However, Apache does go through any number of graceful restarts during the week (mainly because mod_perl2's object reload doesn't seem to be working 100% as desired). I think that the Apache restart causes
.lastweek to link the same file as .thisweek (Cronolog seems to get confused).

The restarts are, realistically, unavoidable.

Any suggestions on a different way to achieve my goal (or a way to fix the above)?

The aim is to produce stats weekly, rotate regularly (preferably weekly) and archive at least monthly (or 4 weekly, whatever). I'm finding it difficult to come up with a good strategy across the 3 requirements (rotate, analyse, archive) that is reliable.

Many Thanks.
 
Old 02-24-2006, 06:57 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
I'm not sure that it meets all of your requirements, but when I had a similar problem with links to Apache's log files I switched to Apache's rotatelogs program. I usually use something like:
Code:
ErrorLog "|/usr/local/apache2/bin/rotatelogs /var/log/httpd/error.log 604800"
SetEnvIf Remote_Addr "127\.0\.0\.1" dontloginf
SetEnvIf Remote_Addr "192\.168\.1\.10" dontloginf
CustomLog "|/usr/local/apache2/bin/rotatelogs /var/log/httpd/access.log 604800" combined env=!dontloginf
The 604800 can be tweaked to rotate the logs on whatever interval you need.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change Debian log rotation of syslog and daemon.log onmountain Linux - Newbie 2 07-31-2008 02:27 AM
Webalizer With Log Rotation dmedici Linux - Software 0 08-17-2004 09:06 AM
Snort log rotation suggestions zerocomm Linux - Security 1 05-26-2004 10:23 PM
manual log rotation will103 Linux - Newbie 2 04-20-2004 02:20 AM
Log rotation - NewB nrastogi Linux - Software 1 02-12-2003 10:44 PM


All times are GMT -5. The time now is 09:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration