From owner-freebsd-questions@FreeBSD.ORG Sat Jun 21 07:27: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 EE7941065680 for ; Sat, 21 Jun 2008 07:27:35 +0000 (UTC) (envelope-from agus.262@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.233]) by mx1.freebsd.org (Postfix) with ESMTP id A984F8FC0C for ; Sat, 21 Jun 2008 07:27:35 +0000 (UTC) (envelope-from agus.262@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so8319484rvf.43 for ; Sat, 21 Jun 2008 00:27:35 -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:references; bh=lThOaVQHotzpxTPbIE6TgGLJzrKdhzrZsiIYVO/vxdk=; b=BvLfFqh7VXtl6C2r8ZmaCGC5sOthnFTpECEwBg0G30XrtGcs2/2hSPkAPpfMTDTyem I8y1x2QRvFuN9MonkASEAaZ5Tbd3EAzqvga25geRaO7SCqnccALpCRCoBE8E+4hSq+Om JK3b5bJXCYhbvkQe8VllsAR1Itsi5QxzW8l4A= 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:references; b=jnbdiNv1W6syKUHL19ytOV9kV9lZ2QQVXLeMA7pT4kUOcUE6lHqXvUUlPcHG/Mr7hI skG8Dzik/zSIQ9AZiCG5NQWL30+W/07SZfvTxf2P74GFbs5KBdp9I5hsUf26yuFqK4JV zCmCeTjSbpC0BSCYfZN1ArJ63lPs8H4UTTS4g= Received: by 10.141.176.6 with SMTP id d6mr8844407rvp.118.1214033255259; Sat, 21 Jun 2008 00:27:35 -0700 (PDT) Received: by 10.140.158.19 with HTTP; Sat, 21 Jun 2008 00:27:35 -0700 (PDT) Message-ID: Date: Sat, 21 Jun 2008 04:27:35 -0300 From: Agus To: "David Robillard" In-Reply-To: <226ae0c60806200746h52366e30ta6dfd204e410218c@mail.gmail.com> MIME-Version: 1.0 References: <226ae0c60806180829i30a79975l40aaf42184af78dd@mail.gmail.com> <20080619073536.GA99679@ei.bzerk.org> <226ae0c60806190533s3863949am188a579802cdf81b@mail.gmail.com> <226ae0c60806200746h52366e30ta6dfd204e410218c@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Sat, 21 Jun 2008 07:27:36 -0000 2008/6/20 David Robillard : > >> 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 > Great....thanks again...I'll be using B and no HUP...i will follow apache's doc and your advice...hehe.. Cheers, Agustin