From owner-freebsd-questions Thu Nov 9 7:57:25 2000 Delivered-To: freebsd-questions@freebsd.org Received: from lcmail2.lc.ca.gov (lcmail2.lc.ca.gov [165.107.12.11]) by hub.freebsd.org (Postfix) with ESMTP id 9A41B37B479 for ; Thu, 9 Nov 2000 07:57:21 -0800 (PST) Received: from CONVERSION-DAEMON by lcmail2.lc.ca.gov (PMDF V5.2-27 #40821) id <0G3R00I01LMYWE@lcmail2.lc.ca.gov> for questions@freebsd.org; Thu, 9 Nov 2000 07:56:59 -0800 (PST) Received: from tagalong ([165.107.42.185]) by lcmail2.lc.ca.gov (PMDF V5.2-27 #40821) with SMTP id <0G3R00IF2LMY5D@lcmail2.lc.ca.gov> for questions@freebsd.org; Thu, 09 Nov 2000 07:56:58 -0800 (PST) Date: Thu, 09 Nov 2000 07:57:16 -0800 From: Drew Tomlinson Subject: RE: full /var In-reply-to: <14858.5381.682481.911014@guru.mired.org> To: 'Mike Meyer' , Bart Cc: questions@freebsd.org Message-id: MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 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. > > > > > 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