debian/0000755000000000000000000000000012265777133007203 5ustar debian/vlogger.examples0000644000000000000000000000004212265774562012407 0ustar vlogger-dbi.conf mysql_create.sql debian/vlogger.manpages0000644000000000000000000000001212265774562012361 0ustar vlogger.1 debian/compat0000644000000000000000000000000212265776175010406 0ustar 5 debian/changelog0000644000000000000000000000363412265777133011063 0ustar vlogger (1.3-4) unstable; urgency=low * Moved to collab-maint and started using git-dpm. * Fixed parsing of -n option (closes: #407047). * Fixed DBI example (closes: #735195). * Rewrote README.Debian. -- RISKO Gergely Thu, 16 Jan 2014 16:24:16 +0100 vlogger (1.3-3.1) unstable; urgency=low * Non-maintainer upload. * Fixed failure to create the proper symlink. Patch by Vasil Kolev (Closes: #645623) * Fixed lintian error clean-should-be-satisfied-by-build-depends by using Build-Depends instead of Build-Depends-Indep. * Suppress lintian warning debhelper-but-no-misc-depends by adding ${misc:Depends} to Depends tag. -- Ognyan Kulev Tue, 26 Jun 2012 12:58:35 +0300 vlogger (1.3-3) unstable; urgency=high * given build-depends management to cdbs (closes: #302340) -- RISKO Gergely Thu, 31 Mar 2005 13:47:56 +0200 vlogger (1.3-2) unstable; urgency=low * cdbsized the package * reqsize bugfix (closes: #302176) -- RISKO Gergely Wed, 30 Mar 2005 21:08:22 +0200 vlogger (1.3-1) unstable; urgency=high * new upstream version * fixed the mysql_create.sql syntax error (closes: #299195) * ensure that $vhost can't be empty (closes: #299794) * non-Debian path in man page changed to a Debian based (closes: #299067) * warning in README.Debian to not use as root and an example for creating non-root system user for web logs is added (closes: #299081) * mention libdbi-perl in README.Debian (closes: #299193) -- RISKO Gergely Sat, 19 Mar 2005 01:51:22 +0100 vlogger (1.1-2) unstable; urgency=low * Fixed package description, it was very ugly. (closes: #277268) -- RISKO Gergely Thu, 21 Oct 2004 14:24:58 +0200 vlogger (1.1-1) unstable; urgency=low * Initial Release. -- RISKO Gergely Thu, 24 Apr 2003 13:15:39 +0200 debian/patches/0000755000000000000000000000000012265774563010636 5ustar debian/patches/0002-Fix-regex-around-request-size-checking-Closes-302176.patch0000644000000000000000000000115012265774562023553 0ustar From ddc015133f9c2ba65c1d4a428cab2ef40ada2bed Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Thu, 16 Jan 2014 12:24:12 +0100 Subject: Fix regex around request size checking (Closes: #302176) --- vlogger | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlogger b/vlogger index 1969cfb..2a3058e 100755 --- a/vlogger +++ b/vlogger @@ -454,7 +454,7 @@ else { $log_line =~ s/^\S*\s+//o; } - if ( $reqsize =~ m/\d|/ && $reqsize > 0 ) { + if ( $reqsize =~ m/^\d*$/ && $reqsize > 0 ) { $tracker{$vhost} += $reqsize; } debian/patches/0006-Parse-n-option-closes-407047.patch0000644000000000000000000000105612265774563017110 0ustar From 1a383ba23218496b71f1209c3ff93395576bcb8e Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Thu, 16 Jan 2014 16:21:56 +0100 Subject: Parse -n option (closes: #407047) --- vlogger | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlogger b/vlogger index 2d667cf..d874126 100755 --- a/vlogger +++ b/vlogger @@ -150,7 +150,7 @@ use IO::Handle; # get command line options our %OPTS; -getopts( 'f:t:s:hu:g:aeivr:d:', \%OPTS ); +getopts( 'f:t:s:hu:g:aeivr:d:n', \%OPTS ); # print out version if ( $OPTS{'v'} ) { debian/patches/0003-Remove-usr-local-reference-from-the-manpage-Closes-2.patch0000644000000000000000000000151412265774562024041 0ustar From 9baffe16990fe631ddc78650b01d2bde71ed6339 Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Thu, 16 Jan 2014 12:25:44 +0100 Subject: Remove /usr/local reference from the manpage (Closes: #299067) --- vlogger.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlogger.1 b/vlogger.1 index 03cf503..2f9770c 100644 --- a/vlogger.1 +++ b/vlogger.1 @@ -153,7 +153,7 @@ LogFormat \*(L"%v \f(CW%h\fR \f(CW%l\fR \f(CW%u\fR \f(CW%t\fR \e\*(R"%r\e\*(L" % .PP Then call it from a customlog: .PP -CustomLog \*(L"| /usr/local/sbin/vlogger \-s access.log \-u www-logs \-g www-logs /var/log/apache\*(R" combined +CustomLog \*(L"| /usr/sbin/vlogger \-s access.log \-u www-logs \-g www-logs /var/log/apache\*(R" combined .SH "OPTIONS" .IX Header "OPTIONS" Options are given in short format on the command line. debian/patches/0004-Fix-time-handling-Closes-645623.patch0000644000000000000000000001063312265774562017503 0ustar From d833d6bc7ea29e1b958910dbbe7229243a12907f Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Thu, 16 Jan 2014 13:19:07 +0100 Subject: Fix time handling (Closes: #645623) --- vlogger | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/vlogger b/vlogger index 2a3058e..2d667cf 100755 --- a/vlogger +++ b/vlogger @@ -315,15 +315,15 @@ chroot("."); my %logs = (); my %tracker = (); -my $LASTDUMP = time(); # pick a mode if ( $OPTS{'e'} ) { + my $initlogtime = time(); $0 = "vlogger (error log)"; # errorlog mode - open ELOG, ">>" . time2str( $TEMPLATE, time() ) - or die ( "can't open $LOGDIR/" . time2str( $TEMPLATE, time() ) ); + open ELOG, ">>" . time2str( $TEMPLATE, $initlogtime ) + or die ( "can't open $LOGDIR/" . time2str( $TEMPLATE, $initlogtime ) ); unless ( $OPTS{'a'} ) { ELOG->autoflush(1); @@ -332,20 +332,21 @@ if ( $OPTS{'e'} ) { if ( -l $OPTS{'s'} ) { unlink( $OPTS{'s'} ); } - symlink( time2str( $TEMPLATE, time() ), $OPTS{'s'} ); + symlink( time2str( $TEMPLATE, $initlogtime ), $OPTS{'s'} ); } - my $LASTWRITE = time(); + my $LASTWRITE = $initlogtime; while ( my $log_line = ) { + my $logtime = time(); unless ( $OPTS{'n'} ) { - if ( time2str( "%Y%m%d", time() ) > + if ( time2str( "%Y%m%d", $logtime ) > time2str( "%Y%m%d", $LASTWRITE ) ) { # open a new file close ELOG; - open_errorlog(); + open_errorlog($logtime); } elsif ( $OPTS{'r'} ) { @@ -354,11 +355,11 @@ if ( $OPTS{'e'} ) { print $filesize[7] . "\n"; if ( $filesize[7] > $MAXSIZE ) { close ELOG; - open_errorlog(); + open_errorlog($logtime); } } - $LASTWRITE = time(); + $LASTWRITE = $logtime; } # we dont need to do any other parsing at all, so write the line. @@ -371,6 +372,7 @@ else { # accesslog mode $0 = "vlogger (access log)"; while ( my $log_line = ) { + my $logtime = time(); # parse out the first word (the vhost) my @this_line = split ( /\s/, $log_line ); @@ -389,7 +391,7 @@ else { # if we're writing to a log, and it rolls to a new day, close all files. unless ( $OPTS{'n'} ) { if ( $logs{$vhost} - && ( time2str( "%Y%m%d", time() ) > + && ( time2str( "%Y%m%d", $logtime ) > time2str( "%Y%m%d", $logs{$vhost} ) ) ) { foreach my $key ( keys %logs ) { @@ -425,9 +427,9 @@ else { } # open the file using the template - open $vhost, ">>${vhost}/" . time2str( $TEMPLATE, time() ) + open $vhost, ">>${vhost}/" . time2str( $TEMPLATE, $logtime ) or die ( "can't open $LOGDIR/${vhost}/" - . time2str( $TEMPLATE, time() ) ); + . time2str( $TEMPLATE, $logtime ) ); # autoflush the handle unless -a if ( !$OPTS{'a'} ) { @@ -440,13 +442,13 @@ else { if ( -l $OPTS{'s'} ) { unlink( $OPTS{'s'} ); } - symlink( time2str( $TEMPLATE, time() ), $OPTS{'s'} ); + symlink( time2str( $TEMPLATE, $logtime ), $OPTS{'s'} ); chdir(".."); } } # update the timestamp and write the line - $logs{$vhost} = time(); + $logs{$vhost} = $logtime; if ($OPTS{'i'}) { $log_line =~ s/^\S*\s+\S*\s+\S*\s+//o; } @@ -486,13 +488,14 @@ sub exitall { # sub to open new errorlog sub open_errorlog { - open ELOG, ">>" . time2str( $TEMPLATE, time() ) - or die ( "can't open $LOGDIR/" . time2str( $TEMPLATE, time() ) ); + my $logtime = $_[0]; + open ELOG, ">>" . time2str( $TEMPLATE, $logtime ) + or die ( "can't open $LOGDIR/" . time2str( $TEMPLATE, $logtime ) ); if ( $OPTS{'s'} ) { if ( -l $OPTS{'s'} ) { unlink( $OPTS{'s'} ); } - symlink( time2str( $TEMPLATE, time() ), $OPTS{'s'} ); + symlink( time2str( $TEMPLATE, $logtime ), $OPTS{'s'} ); } # autoflush it unless -a debian/patches/series0000644000000000000000000000052312265774563012053 0ustar 0001-Ensure-that-vhost-has-some-value-even-when-parsing-f.patch 0002-Fix-regex-around-request-size-checking-Closes-302176.patch 0003-Remove-usr-local-reference-from-the-manpage-Closes-2.patch 0004-Fix-time-handling-Closes-645623.patch 0005-Make-vlogger-dbi.conf-chroot-compatible-closes-73519.patch 0006-Parse-n-option-closes-407047.patch debian/patches/0005-Make-vlogger-dbi.conf-chroot-compatible-closes-73519.patch0000644000000000000000000000107112265774563023625 0ustar From b90fcc67f9fca5c497c622e1a5758e69b5f45232 Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Thu, 16 Jan 2014 16:03:45 +0100 Subject: Make vlogger-dbi.conf chroot compatible (closes: #735195) --- vlogger-dbi.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlogger-dbi.conf b/vlogger-dbi.conf index 64d0f88..5f816be 100644 --- a/vlogger-dbi.conf +++ b/vlogger-dbi.conf @@ -1,4 +1,4 @@ -dsn DBI:mysql:database=wwwusage;host=localhost +dsn DBI:mysql:database=wwwusage;host=127.0.0.1 user wwwusage pass wwwusage dump 30 debian/patches/0001-Ensure-that-vhost-has-some-value-even-when-parsing-f.patch0000644000000000000000000000117712265774562024204 0ustar From bcbdd6b7ae07bec04deb690c05f450ac734d6238 Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Thu, 16 Jan 2014 12:21:29 +0100 Subject: Ensure that vhost has some value even when parsing fails (Closes: #299794) --- vlogger | 1 + 1 file changed, 1 insertion(+) diff --git a/vlogger b/vlogger index d034b7a..1969cfb 100755 --- a/vlogger +++ b/vlogger @@ -380,6 +380,7 @@ else { if ( $vhost =~ m#[/\\]# ) { $vhost = "default" } $vhost =~ /(.*)/o; $vhost = $1; + $vhost = 'default' unless $vhost; if ( $OPTS{'i'} ) { $reqsize = $this_line[1] + $this_line[2]; debian/README.Debian0000644000000000000000000000103012265776175011243 0ustar vlogger for Debian ------------------ vlogger refuses to start as root, for security reasons. You can add a new system user if you don't want to reuse any other use for running vlogger: adduser --home /var/log/vlogger --system --ingroup nogroup www-logs chown www-logs.nogroup /var/log/vlogger chmod 0700 /var/log/vlogger If you want to use the DBI interface for bandwidth statistics, you should make sure that the libdbi-perl package is also installed. -- Gergely Risko , Thu, 16 Jan 2014 16:28:25 +0100 debian/source/0000755000000000000000000000000012265774562010506 5ustar debian/source/format0000644000000000000000000000001412265774562011714 0ustar 3.0 (quilt) debian/dirs0000644000000000000000000000001112265774562010062 0ustar usr/sbin debian/docs0000644000000000000000000000000712265774562010056 0ustar README debian/control.in0000644000000000000000000000146412265776175011225 0ustar Source: vlogger Section: web Priority: optional Maintainer: RISKO Gergely Build-Depends: @cdbs@ Standards-Version: 3.9.5.0 Package: vlogger Architecture: all Depends: ${perl:Depends}, libtimedate-perl, ${misc:Depends} Suggests: libdbi-perl Description: virtual web logfile rotater/parser Vlogger is a little piece of code borned to handle dealing with large amounts of virtualhost logs. It's bad news that apache can't do this on its own. Vlogger takes piped input from apache, splits it off to separate files based on the first field. It uses a file handle cache so it can't run out of file descriptors. It will also start a new logfile every night at midnight, and maintain a symlink to the most recent file. For security, it can drop privileges and do a chroot to the logs directory. debian/rules0000755000000000000000000000030512265774562010264 0ustar #!/usr/bin/make -f DEB_AUTO_UPDATE_DEBIAN_CONTROL := true include /usr/share/cdbs/1/rules/debhelper.mk binary-post-install/vlogger:: install $(CURDIR)/vlogger $(CURDIR)/debian/vlogger/usr/sbin debian/control0000644000000000000000000000151512265777640010613 0ustar Source: vlogger Section: web Priority: optional Maintainer: RISKO Gergely Build-Depends: cdbs, debhelper, dh-buildinfo Standards-Version: 3.9.5.0 Package: vlogger Architecture: all Depends: ${perl:Depends}, libtimedate-perl, ${misc:Depends} Suggests: libdbi-perl Description: virtual web logfile rotater/parser Vlogger is a little piece of code borned to handle dealing with large amounts of virtualhost logs. It's bad news that apache can't do this on its own. Vlogger takes piped input from apache, splits it off to separate files based on the first field. It uses a file handle cache so it can't run out of file descriptors. It will also start a new logfile every night at midnight, and maintain a symlink to the most recent file. For security, it can drop privileges and do a chroot to the logs directory. debian/copyright0000644000000000000000000000051312265777133011135 0ustar This package was debianized by RISKO Gergely on Thu, 24 Apr 2003 13:15:39 +0200. It was downloaded from http://n0rp.chemlab.org/vlogger Upstream Author: "steve j. kondik" Copyright: LGPL (can be found at /usr/share/common-licenses/LGPL) Copyright 2003 steve j. kondik