Mailing List Archive

Support open source code!


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

Re: Apache question



I think that the best way to rotate apache logs is by configuring
apache to use the rotatelogs program via httpd.conf. Basically
apache writes to the rotatelogs program and the rotatelogs program
then writes to the files. In the httpd.conf file where you tell
rotatelogs to run, you specify the location of the logfile and 
a number of seconds after which to rotate. When the time to rotate
comes, the rotatelogs program closes the logfile, renames it and 
opens a new log file. Apache never knows the difference. You don't
have to worry about who/what is connected to your webserver. See the
man page of rotatelogs for setup.

I pretty much use this and it works great. I wrote my own version
of rotatelogs though which integrates better with scripts I run
around it, ie stores logs in a different directory, uses different
names and sets up symlinks to point to latest logs. It also works
with signals rather than times, cause I wanted more control over
rotating logs than a number of seconds which was specified when
apache was started. It's been running under pretty heavy traffic
since early this year. If anyone wants it give me a shout.

Incidently, anyone else running webalizer to generate logfile reports?
It cored on me last week after being slashdotted. There was a small 
bug in the mangle agents code. If anyone else wants the fix for 2.01,
let me know. BTW, What do other people use?

PS. rotatelogs is a c program included in the apache source. You can
probably find it with locate. RH also has a logrotate program which
deals with system logfiles (including RH apache). This is different
then the rotatelogs program I mention above.

PPS. apachectl is the apache control start/stop/configcheck/reload/etc
script. Not sure where RH puts it by default. Just use locate to find it.
The default sysv start script is more than likely using it to start/stop
apache.

PPPS. I also recommend building/installing apache yourself rather than
the default RH rpms.

Tom.

On Mon, May 28, 2001 at 07:44:58AM -0000, Jean-Christian Imbeault wrote:
> >It's not particularly serious, it just means that the processes
> >didn't die right away.
> 
> Could this possibly lead to the creation of a zombie httpd that could keep a 
> connection open and busy?
> 
> >You might want to write your own log rotation script
> >for Apache which uses signal SIGUSR1 instead of SIGHUP.
> 
> I'll susbstituthe the HUP signals for SIGUSR1 in the logrotate script.
> 
> >A lot of the work is handled by the "apachectl" script
> >which comes with Apache.
> 
> Couldn't find a file called apachectl on my system ...
> 
> >Keep in mind that as long as you have child processes alive
> >the log file will still be written to, even if it is renamed.
> >So the log rotation script will have to wait for a while before
> >doing, e.g. compression.
> 
> If the log rotation script *did* rename the file before the child died, 
> would this cause the creation of the zombie children?
> 
> >Ahh, the joys of being a webmaster :-)
> 
> Tell me about it! Worst is I am *not* a web master by training ... just a 
> simple programmer ... woe is me ...
> 
> Jc
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> -----------------------------------------------------------------------
> Next Technical Meeting:  Sat, May 12 13:30- 
> Next Nomikai Meeting:    Fri, June (TBA) 19:30- Tengu Tokyo Eki Mae
> -----------------------------------------------------------------------
> more info: http://www.tlug.gr.jp           Sponsor: Global Online Japan
> 

-- 
Thomas O'Dowd. - Nooping - http://nooper.com
tom@example.com - Testing - http://nooper.co.jp/labs


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links