[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apache Log Rotation - FAQ 10.16



On Fri, Dec 09, 2005 at 01:45:51PM +0800, Uwe Dippel wrote:
> There are many posts on this problem; and the reason is understood.
> 
> To me, the FAQ 10.16 seems wrong:
> 
> Log Rotation: Normally, logs are rotated by renaming the old files, 
> then sending httpd(8) a SIGUSR1 signal to cause Apache to close its old
> log files and open new ones. This is no longer possible, as httpd(8) has
> no ability to open log files for writing once privileges are dropped.
> httpd(8) must be stopped and restarted:
> # apachectl stop && apachectl start
> 
> This is all I get here:
> # apachectl stop && 
> /usr/sbin/apachectl stop: httpd stopped
> /usr/sbin/apachectl start: httpd (pid 18132) already running
> 
> In the end, it doesn't restart; leaving the users out until I wait and
> restart httpd
> 
> And the log isn't rotated neither. Chances are, the author meant something
> like
> # apachectl stop
> # [newsyslog or similar]
> # apachectl start
> 
> If the text in the FAQ just kills httpd, it ought to be corrected, AFAICS.
> 
> Could you please share your preferred methods to rotate the
> /var/www/logs/, ?

I use

$ sudo apachectl stop && sleep 3 && sudo apachectl startssl

on the rare occassion where I do this.

It's not the neatest I can think of, but it works. The '3' is pretty
much arbitrary, and I've used anything from 1 to 5.

		Joachim



Visit your host, monkey.org