[Pkg-awstats-devel] Bug#415334: Installation instructions in README.Debian do not completely address multiple site configurations

Eric Wadsworth eric at wadhome.org
Sun Mar 18 15:58:21 CET 2007


Package: awstats
Version: 6.5+dfsg-1

I was a bit lost after installing awstats on my new apache2 box.

According to the instructions in README.Debian:
========================================================
Multiple stats
--------------

To handle multiple stats (eg. using VirtualHosts in Apache) you should...

 1) Place all configs in /etc/awstats.

 2) Name the configs "awstats." + whatever you want - ".conf" (eg.
    awstats.www.debian.org.conf"). But avoid "awstats.awstats.conf.

 3) Run awstats.pl with each config one by one (have a look at the scripts
    awstats-update and awstats_updateall.pl in
    /usr/share/doc/awstats/examples).
========================================================

But in awstats.conf.local, it says:
========================================================
# You can overrides config directives here.
# This is particularly useful for users with several configs for
# different virtual servers, who want to reuse common parameters.
# Also, this file is not updated with each new upstream release.
========================================================

So I'm thinking that I like preserving the parent .conf file, and just
touching .conf.local files for each virtual host. After quite a bit of
experimentation, I eventually created five different .conf files:
awstats.site1.com.conf
awstats.site2.com.conf
awstats.site3.com.conf
awstats.site4.com.conf
awstats.site5.com.conf

Each file has contents like this:
========================================================
Include "/etc/awstats/awstats.conf"
Include "/etc/awstats/awstats.site1.com.conf.local"
========================================================

I put one line, which has a directive common to all sites, into
awstats.conf.local:
========================================================
LogFormat=1
========================================================

And then I made five .conf.local files, with contents like this:
========================================================
LogFile="/var/log/apache2/site1.com_access_log"
SiteDomain="site1.com"
HostAliases="site1.com www.site1.com"
DirData="/var/lib/awstats/site1.com"
========================================================

This way I can call the perl scripts and specify the site name, and it
gets into the hierarchy of config files properly.

So, as a Debian newbie, and as a person relatively inexperienced with
Linux, the instructions on how to configure awstats seemed
contradictory, and I had to figure out a configuration scheme on my own.
I have no idea if my scheme makes sense, but it would be a good idea to
give the user some direction in this area.

One thing I haven't figured out yet has to do with the contents of
/etc/cron.d/awstats. It currently has this line:
0,10,20,30,40,50 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl -a -f
/etc/awstats/awstats.conf -a -r /var/log/apache/access.log ] &&
/usr/lib/cgi-bin/awstats.pl -config=awstats -update >/dev/null

It looks like it only hits the parent config file, thereby missing all
the virtual host entries. Am I supposed to be replicate this line, and
add an entry for each site? This is not detailed in the "Multiple Stats"
section of README.Debian, and should be added if it is needed.

Thanks, developers, for all the great work you do! Keep it up!

I am using Etch. "uname -a" emits:
Linux squashbot 2.6.18-4-686 #1 SMP Wed Feb 21 16:06:54 UTC 2007 i686
GNU/Linux
First line on dmesg emits:
Linux version 2.6.18-4-686 (Debian 2.6.18.dfsg.1-11) (waldi at debian.org)
(gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Wed
Feb 21 16:06:54 UTC 2007

--- Eric Wadsworth
eric at wadhome.org




More information about the Pkg-awstats-devel mailing list