Index of /software/apache-vsl
Name Last modified Size Description
Parent Directory -
apache-vsl-2.0/ 05-Jul-2007 02:06 -
apache-vsl-2.0.tar.gz 05-Jul-2007 02:31 11K
apache-vsl_2.0-1.diff.gz 05-Jul-2007 11:45 1.6K
apache-vsl_2.0-1.dsc 05-Jul-2007 11:45 327
apache-vsl_2.0-1_all.deb 05-Jul-2007 11:45 5.8K
apache-vsl_2.0.orig.tar.gz 05-Jul-2007 02:31 11K
apache-vsl - Apache VirtualHost log splitter daemon
Version 2.0, Copyright (C) 2007 Ryan Finnie
apache-vsl is a program that handles multiple Apache VirtualHosts,
automatically splitting the logs for each VirtualHost into separate
time-based files. Each VirtualHost is individualy customizable. For
example, www.foo.com could have logs in the format
/logs/www.foo.com/access_log-YYYYMM, while www.bar.com could have logs
in the format /home/joe/logs/www.bar.com/YYYY/Mon.log. Symlinks can
also be maintained, always pointing to the most recent (and optionally
previous) logs.
apache-vsl also supports program triggers after a log file has been
finished. Run webalizer against the logs? Gzip the logs? It's up to
you.
apache-vsl runs as a single filter process, started by Apache. It
intelligently manages open filehandles. When a log entry for a
VirtualHost is written, the filehandle remains open for a period of time
after (5 minutes by default). Most user agent sessions are bursts of a
dozen or so requests at a time, so this is an efficient way of managing
filehandles. This also means that if, for example, you have 1000
VirtualHosts but only 50 are "popular", you don't have 1000 filehandles
open all the time.
Once apache-vsl is installed, Apache never has to be restarted to rotate
logs, because the apache-vsl handles the rotation within its own
process. The apache-vsl process doesn't have to be restarted either; it
automatically checks for changes to apache-vsl.conf.
apache-vsl handles access logs only, not SSL logs or Error logs.
== REQUIREMENTS ==
* Perl, probably 5.6.0 minimum.
* Several Perl modules. Almost all should be part of any base Perl
installation. One that you will need to get yourself is
Config::IniFiles. On Debian systems, this is the
libconfig-inifiles-perl package.
* While Apache itself technically isn't required, apache-vsl is rather
useless without it. 1.3 through current (2.2 at this time) are
supported.
== INSTALLATION ==
1. "make install" is sufficient to install files to /usr/local/bin and
/usr/local/etc. The rest of these instructions will assume you
installed to this location.
2. Review /usr/local/etc/apache-vsl.conf, and modify as desired.
3. Add the following to your Apache configuration:
LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
CustomLog "|/usr/local/bin/apache-vsl" vhost_combined env=use-vsl
These lines must go in the main Apache configuration namespace, not
a VirtualHost.
4. For each VirtualHost you want to use with apache-vsl, remove (or
comment out) the existing CustomLog entry, and add the follow line:
SetEnv use-vsl yes
5. Restart Apache. You should see a single apache-vsl process running,
in addition to your normal Apache processes.
6. Any apache-vsl-specific errors will be sent to the main ErrorLog
handler (/var/log/apache/error.log or similar). VirtualHost-specific
errors will continue to be handled like normal (VirtualHost-specific
ErrorLog handler, or main handler if no VirtualHost-specific handler
is defined).
== LICENSE ==
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.