Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Nov 2005 02:12:39 +0100
From:      Holger Kipp <hk@alogis.com>
To:        "Dan O'Connor" <dan@ferrarishields.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Rotating web server logs without restarting Apache
Message-ID:  <20051126011239.GB84800@intserv.int1.b.intern>
In-Reply-To: <007601c5f221$b0d9e640$0599460a@Dan>
References:  <200511250845.43542.distro.watch@msa.hinet.net> <007601c5f221$b0d9e640$0599460a@Dan>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 25, 2005 at 04:38:14PM -0800, Dan O'Connor wrote:
> >Every time my httpd-access.log file is rotated I need to restart 
> >Apache, otherwise it won't write into the new httpd-access.log file.
> 
> In /etc/newsyslog.conf:
> 
> /var/log/httpd-access.log               644  4     100  *     J 
> /var/run/httpd.pid  30
> /var/log/httpd-error.log                644  4     100  *     J 
> /var/run/httpd.pid  30
> 
> This will signal apache to do a graceful restart following a log 
> rotation...

Don't compress those files in this case! For a comprehesive
explanation see

http://www.freebsddiary.org/rotatelogs.php

but it boils down to the following: if sending SIGUSR1 to apache,
not all children might have finished writing to the log files 
immediately, so the file might still be written to (it was not
copied, but merely renamed by newsyslog) for some time (depending
on the requests, client bandwidth, delays etc. this might be a few 
minutes for http-connections to finish).



Regards,
Holger Kipp
alogis AG, Berlin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051126011239.GB84800>