Rotating web server logs without restarting Apache
Calvin OnEarth
hangdog at gmail.com
Fri Nov 25 02:09:56 GMT 2005
My very non-orthodox way is to:-
1) copy the entire content of the log file out for storage, renamed
according to date.
2) cat /dev/null to the apache logfile
On 11/25/05, Philip Murray <pmurray at nevada.net.nz> wrote:
> On 25/11/2005, at 1:45 PM, Ladislav Bodnar wrote:
> > Is there a way for Apache (version 2.0.55 on FreeBSD 6.0) to write
> > to the
> > new log file without the need to restart it? I restart it routinely
> > from a
> > cron job, but occasionally Apache fails to restart (or more
> > precisely, if
> > fails to shutdown completely before it is told to come up again).
>
> Look at sysutils/cronolog in ports. Apache logs to cronolog via a
> pipe and cronolog will do rotation for you without needing to restart
> Apache.
>
> Cheers
>
> Phil
More information about the freebsd-stable
mailing list