On Tue, May 15, 2007 at 08:21:24PM +0200, Przemyslaw Nowaczyk wrote: > On Tue, May 15, 2007 at 07:10:28PM +0200, Bambero wrote: > > Hello > > > > I'm wondering how to implement log rotation with chrooted apache. > > > > Anyone solved this problem ? > > > > Thanks > > Bambero > > same as with any other log..? (newsyslog(8) && cron(8)) > cheers,
The problem there is that sending a SIGHUP won't work as expected, and neither will "apachectl restart" If you don't mind a second or two of down time then you can use something like this in newsyslog.conf as a restart command: "apachectl stop;sleep 1;apachctl start;sleep 10;apachectl start" The first sleep gives apache a second to finish active requests before trying to start again. The second sleep and start is to catch the case where the first start fails because apache is still running. This is far from perfect, but works is you're just serving pages (as opposed to large, long-lived downloads). Other, better solutions involve piping logs to chronolog or something similar. -- Darrin Chandler | Phoenix BSD User Group | MetaBUG [EMAIL PROTECTED] | http://phxbug.org/ | http://metabug.org/ http://www.stilyagin.com/ | Daemons in the Desert | Global BUG Federation