Forum Moderators: travelin cat
Am moving beyond my older server technology (Webstar 4 / OS 9) to Apache2/PHP/MySQL. Feel like a newbie all over again :) Would someone kindly tell me what their preferred tools are for managing log rolling in Apache2? I am using 10.3.7 and the ServerLogistics packages as a starting point to learn. Am very comfortable configuring the httpd with BBEdit. Currently am logging in just one master log. Eventually will likely use the log splitting in the VH arguments in httpd file, but for now:
Would like to understand the following:
How to roll the Apache2 logs (both visitation and error) on a chronological basis (every month, week or day).
How to move/archive/rename the logs automatically for storage.
How Apache is managed during all this (are Apache processes quit, logs rolled, then Apache restarted, or is there some other method?)
Many thanks in advance.
Apache log rotation is done via external programs/scripts.
Basically you need to write a script that will:
I think there should be millions of written scripts for this purpose, it seems like a trivial problem.
Use cron to run the script periodically. Type
man cronto find out more.
OR:
If you're talking about MacOS: logrotate is a professional tool for log rotation. A version for MacOS can be found at Fink [fink.sourceforge.net]
ALSO:
O'Reilly MacOS hacks [oreillynet.com]
As for Fink -- I've heard about Fink quite a bit. Visiting their website, it is difficult at first to figure out what Fink is. Is it an application, an open-source community porting other applications, or what (the latter). Their web offerings tease with potential solutions for my log rolling quest, but nothing there fits the bill. Log analysis I already take care of, but rolling is a seemingly simple question to which there is no obvious answers out there.
I would think there are oodles of solutions where one can append a date/time stamp or some other custom name to each log when archiving (to avoid over-writing the last archive with the next archive. Will need to dig deeper. All hints appreciated.
and futher:
[cronolog.org...]
[localhost...]
[builder.com.com...]
[builder.com.com...]