From owner-freebsd-questions@FreeBSD.ORG Fri Jun 20 14:46:35 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 454B9106567B for ; Fri, 20 Jun 2008 14:46:35 +0000 (UTC) (envelope-from david.robillard@gmail.com) Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.187]) by mx1.freebsd.org (Postfix) with ESMTP id 01D0C8FC18 for ; Fri, 20 Jun 2008 14:46:34 +0000 (UTC) (envelope-from david.robillard@gmail.com) Received: by rn-out-0910.google.com with SMTP id j71so158152rne.12 for ; Fri, 20 Jun 2008 07:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=hB+AQjAC1bkRdu7bZZpM1GkeiNuX4B4OIMddQ9nWWJY=; b=q3ZVM0O4KGZP/jmyfK9ZZppIvg6vP8Ix+j94PriRChO8Pj30U5qDTWpr33IA13LzlJ Om7ar36fETOxnCWlzbHkgP1YVkOpEc0L/rhJlL/VkzRNATvsxhuyDAiRZcxX28f4A9Rc 22anr9CD0mJY5G3lLyTrEapCNXdIyOTuIhqbU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=wftnPRwBwQqLzn8wa9tTrkTEIv2Odx+ogUwLcde6/o4v0GtH31fNo/03mFVHSD2Zve 41p7XsrhYB76P5rbwEx2At+ilEB4buOTPLX/yjHRVfXFCiE6Hfoa1ymg+/ShfJoeEgd0 QBEULj3V84bCPXX4Aa58utMcjxvpmI7GklYtg= Received: by 10.143.44.17 with SMTP id w17mr1296478wfj.242.1213973193586; Fri, 20 Jun 2008 07:46:33 -0700 (PDT) Received: by 10.151.82.15 with HTTP; Fri, 20 Jun 2008 07:46:33 -0700 (PDT) Message-ID: <226ae0c60806200746h52366e30ta6dfd204e410218c@mail.gmail.com> Date: Fri, 20 Jun 2008 10:46:33 -0400 From: "David Robillard" To: Agus In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <226ae0c60806180829i30a79975l40aaf42184af78dd@mail.gmail.com> <20080619073536.GA99679@ei.bzerk.org> <226ae0c60806190533s3863949am188a579802cdf81b@mail.gmail.com> Cc: Ruben de Groot , FreeBSD Questions , Valerio Daelli Subject: Re: Vsftpd rotate logs with newsyslog... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2008 14:46:35 -0000 >> Thank u all very much guys....i will see if i do a graceful or simply a >> restart cause i dont think the apache will be getting too many connections >> all the time....but that clarifications was quite good David....and thank u >> for the example....that is always the best way to understand things...much >> appreciated... >> >> Will try both....just a question about compression...What i understood >> from your mail is that as apache takes some time to let his children close >> all connections i shouldn zip those logs cause, newsyslog wont wait till >> apache finishes and probably will xip logs that are still being access by >> the children? if htat is the case using a HUP will close all and allow me to >> use compresion? Yes it would. But if you go this route, you might loose some logs from the childrens. If you don't run a busy server with lots of hits and lots of VirtualHosts, then that might not be a problem for you. Like Ruben said, YMMV. IMHO, if the Apache Best Practices and documentation say you should use USR1 and not compress the logs automatically via newsyslog(8) or logrotate(8), then that's what I do. Of course, you can compress the logs at a later time once the files have been rotated of course. But with today's disk sizes and SAN storage, I'd be surprised that a few Apache log files can pose a disk space problem. Think of it another way. If today you run a single very small site, then you might want be tempted to use HUP and compression simply because it's easier and, well, it works. Agreed that using USR1 seems a little more complicated (a little) and might seem like an overkill setup for a single small site. But tomorrow you might end up working for a very large site that runs a huge number of VirtualHosts with thousands of hits per seconds on a three-tier web platform that has a cluster of web servers, application servers and backend databases. If you've learned and used the Best Practices back in the days when you had your single little web site, then it won't be a secret to you and you'll be ready to tackle the demands of a bigger site. Besides, it's not like using USR1 is some form of arcane black sysadmin magic, right? :) If you need more info on this topic, check out the official documentation (i.e. RTFM ;-) Apache 1.3 http://httpd.apache.org/docs/1.3/stopping.html Apache 2.0 http://httpd.apache.org/docs/2.0/stopping.html Apache 2.2 http://httpd.apache.org/docs/2.2/stopping.html > Sorry guys...got one more doubt....Why do u use B (binary) if apache logs > are simple text? any particular reason? >From the newsyslog.conf(5) man page: B indicates that the log file is a binary file, or has some special format. Usually newsyslog(8) inserts an ASCII message into a log file during rotation. This message is used to indicate when, and sometimes why the log file was rotated. If B is specified, then that informational mes- sage will not be inserted into the log file. Indeed, the Apache logs are ASCII files. I use the B flag in newsyslog.conf(5) simply because I don't want to have newsyslog(8) to write anything in the Apache logs. Why? Because it confuses our Apache log file analyzers. That's all. I mean, I know the reasons why the logs are rotated and I know that it's newsyslog(8) that did it (I should know, I'm the one who configured it). So I don't need a reminder inside the logs about it. Once again, YMMV. HTH, David -- David Robillard UNIX systems administrator & Oracle DBA CISSP, RHCE & Sun Certified Security Administrator Montreal: +1 514 966 0122