Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Nov 2000 07:57:16 -0800
From:      Drew Tomlinson <drewt@writeme.com>
To:        'Mike Meyer' <mwm@mired.org>, Bart <bart@no-x.nl>
Cc:        questions@freebsd.org
Subject:   RE: full /var
Message-ID:  <BA5D0CE1CBB2D411B6AA00A0CC3F02390AF6FA@ldcmsx01.lc.ca.gov>
In-Reply-To: <14858.5381.682481.911014@guru.mired.org>

next in thread | previous in thread | raw e-mail | index | archive | help
From the Apache manual:

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'T WORK.

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.

HTH,

Drew

> -----Original Message-----
> From: Mike Meyer [mailto:mwm@mired.org]
> Sent: Wednesday, November 08, 2000 7:08 PM
> To: Bart
> Cc: questions@freebsd.org
> Subject: Re: full /var
>
>
> Bart <bart@no-x.nl> types:
> > Hi all!
> > I small questions about /var/log. Can I remove
> > the Apache log files in this directory without
> > any problems ? Or should Apache be stopped first ?
>
> Yes, it won't cause a problem. However, if apache has the log file
> open, the file will still be on disk, with no way to reach it from the
> file system. If that's the case, you need to restart apache. Possibly
> rereading the config file will do the trick.
>
> 	<mike
>
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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