From owner-freebsd-isp@FreeBSD.ORG Wed Feb 7 16:01:14 2007 Return-Path: X-Original-To: freebsd-isp@freebsd.org Delivered-To: freebsd-isp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3D9D16A401 for ; Wed, 7 Feb 2007 16:01:13 +0000 (UTC) (envelope-from netsecuredata@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.230]) by mx1.freebsd.org (Postfix) with ESMTP id B7D7013C4B3 for ; Wed, 7 Feb 2007 16:01:13 +0000 (UTC) (envelope-from netsecuredata@gmail.com) Received: by nz-out-0506.google.com with SMTP id i11so253630nzh for ; Wed, 07 Feb 2007 08:01:13 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=aheuFeTsG+Q4XJmCLMBiGWPLHBvZkbkNRi3qax2G8Ud2VG8+G23y9n4fnH7wrszI6voDFdEJVKvI3K0iGxjTK8MciJdh0wkWPMXjH0W0lr/4mI6VbimfU0uLeyYIrA3hzZzD2j/Ld+H1SpGM2PttPGIcC4xV5Zry3j90sucPmNY= Received: by 10.114.194.1 with SMTP id r1mr865122waf.1170862387045; Wed, 07 Feb 2007 07:33:07 -0800 (PST) Received: by 10.114.106.19 with HTTP; Wed, 7 Feb 2007 07:33:06 -0800 (PST) Message-ID: Date: Wed, 7 Feb 2007 10:33:06 -0500 From: "Jorge Evangelista" To: freebsd-isp@freebsd.org In-Reply-To: <200702070934.34074.lists@jnielsen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20070207130614.GA15328@fupp.net> <200702070934.34074.lists@jnielsen.net> Subject: Re: Per virtualhost bandwidth/hitrate statistics for Apache X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2007 16:01:14 -0000 Hi Anders, A days ago I have configured a web server with bandwidth manager (module bwmod) compile with apache web server. It works fine. You could try install this module http://bwmod.sourceforge.net/index.html and test with your virtualhosts. Here, my small guide install, it made in spanish. Instalando el bwmod, primero comentar las lineas mencionadas abajo vi mod_bw.c /* Compatibility for APR < 1 */ #if (APR_MAJOR_VERSION >=3D 1) #define apr_atomic_inc32 apr_atomic_inc #define apr_atomic_dec32 apr_atomic_dec #define apr_atomic_add32 apr_atomic_add #define apr_atomic_cas32 apr_atomic_cas #define apr_atomic_set32 apr_atomic_set #endif Compilar con el siguiente comando /usr/local/apache2/bin/apxs -i -a -c mod_bw.c Habilitar en apache httpd.conf BandWidthModule On Para bandwitdh ilimitado a una IP BandWidth 200.168.190.6 0 Para colocar el bandwidth a los virtual hosts Limit al internal users to 1000 kb/s with a minimum of 50kb/s BandwidthModule On ForceBandWidthModule On Bandwidth all 1024000 MinBandwidth all 50000 LargeFileLimit * 500 50000 Servername www.example.com Limit every user to a max of 10Kb/s on a vhost : BandwidthModule On ForceBandWidthModule On Bandwidth all 10240 MinBandwidth all -1 Servername www.example.com Examples : BandWidth all 102400 MinBandWidth all 50000 The example above, will have a top speed of 100kb for the 1=C2= =BA client. If more clients come, it will be splitted accordingly b= ut everyone will have at least 50kb (even if you have 50 clients) BandWidth all 50000 MinBandWidth all -1 This example, makes everyone have 50kb as top speed. On 2/7/07, John Nielsen wrote: > On Wednesday 07 February 2007 08:06, Anders Nordby wrote: > > I just wonder if anyone has any good hints about software to use (Apach= e > > module?) for fetching per-virtualhost statistics about bandwidth usage > > and hitrates (hits per second) from Apache. I've been using mod_watch > > for a while, to graph this with MRTG, but it's discontinued it seems. > > > > What do people use to measure statistics per virtualhost? > > I use Apache's logrotate and a separate log directory for each virtualhos= t. I > have a script that runs from cron every day that runs the logs through > webalizer and then cleans up logs older than a specified number of days. = In > fact (since I'm feeling like sharing), here it is: > > #!/bin/sh > for path in `cat /usr/local/scripts/logpaths.txt` ; do > for log in `find ${path} -name access\* | sort -n` ; do > if [ -r ${path}/hostname.txt ]; then > host=3D`cat ${path}/hostname.txt` > /usr/local/bin/webalizer -Q -p -n ${host} \ > -o ${path} ${log} > else > /usr/local/bin/webalizer -Q -p -o ${path} ${log} > fi > done > find ${path} -name \*.log\* ! -newermt '1 month ago' -delete > done > > The script depends on the existence of a "logpaths.txt" file, which conta= ins a > list of directories to scan, one per line. It also supports an > optional "hostname.txt" for each directory so webalizer can use the right= one > in the title of its reports. Webalizer output is stored in the log direct= ory > but that could easily be changed. > > The output is plain HTML, so you can publish it on a (presumably private) > webserver somewhere. Since I give certain clients access to their reports= I > use webmin for this. However I just point webmin to a dummy file within e= ach > log directory and don't let it actually run webalizer (since my script > already takes care of that). So just the "View report" button works, but = it > gets the job done. > > JN > _______________________________________________ > freebsd-isp@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-isp > To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org" > --=20 "The network is the computer"