httpd-log in CERN server: newbie question

Alicia Abramson aabrams at american.edu
Mon Dec 16 18:12:30 EST 1996


I ran into that same problem with the apache web server.  Here's what the
apache people have to say about how to do this for apache (this should
transfer over to cern-httpd).

-------------------------------------------Begin Included
Message----------------------------------------------
How to reset your log files

Sooner or later, you'll want to reset your log files 
(access_log and error_log) because they are too big, 
or full of old information you don't need.
access.log typically grows by 1Mb for each 10,000 requests.

Most people's first attempt at replacing the logfile
is to just move the logfile or remove the logfile. This doesn'twork.

Apache will continue writing to the logfile at the same 
offset as before the logfile moved. This results in a new 
logfile being created which is just as big as the old one,
 but it now contains thousands (or millions) of null characters.

The correct procedure is to move the logfile,
 then signal Apache to tell it to reopen the logfiles.

Apache is signaled using the SIGHUP (-1) signal. e.g. 

     mv access_log access_log.old
     kill -1 `cat httpd.pid` 

Note: httpd.pid is a file containing the process id of the 
Apache httpd daemon, Apache saves this in the
same directory as the log files.

Many people use this method to replace 
(and backup) their logfiles on a nightly or weekly basis.

--------------------------------------------End Included
Message----------------------------------------------
Alicia Abramson

PS I put those two lines into an executable shell script--and I found it
works best when
I use the full path to the httpd.pid file.

At 03:03 PM 12/16/96 -0800, you wrote:
>We are running the CERN server on the City's new proxy server. The httpd-log
>is getting very large. Following the directions in Lincoln Stein's book, I
>sent a
>command 'kill -HUP ###' where ### was the httpd-pid. 
>
>The httpd-errors log says it has successfully restarted, and everything is
>working. But it did not start a new httpd-log as I expected it to: it's
>still adding to the old one. What have I missed?
>
>I made a cp of the whole httpd-log file before I tried the kill command.
>Shall I just edit the (still growing) for-reals file and delete the first
>gazillion lines to eliminate all the old entries; then work with the copy to
>experiment with log analysis?  
>
>Thanks.
>
>Miriam (gee, I hope I can't destroy this machine with a keystroke) Bobkoff
>
>*******************************************************************
>Miriam Bobkoff             mbobkoff at ci.santa-fe.nm.us
>Santa Fe Public Library
>145 Washington Avenue           personal: mbobkoff at rt66.com
>Santa Fe, NM 87501              http://www.rt66.com/~mbobkoff/
>(505)984-6832
>*******************************************************************
>
>
 
                             *-*-*-*-*-*-*-*-*-*-*-*-*- 
                             | Alicia Abramson        |
                             * Head, Library Systems *
                             | American University   |
                             * (202) 885-3228         *
                             | aabrams at american.edu   |
                             *-*-*-*-*-*-*-*-*-*-*-*-*-



More information about the Web4lib mailing list