awstats under debian

While setting up awstats und debian, I ran into some errors. Here’s what happened, and how to get over it.

Get awstats

~# apt-get install awstats

Configure awstats

~# cd /usr/local/awstats/
/usr/local/awstats# perl awstats_configure.pl

answer the questions, and the configure script failes with

Error: Failed to open '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf' for read.

Hmm … the awstats.model.conf and the wwwroot directory don’t exist, so I ran

~# gunzip -v /usr/share/doc/awstats/examples/awstats.model.conf.gz

And beacuse the debian installer doens’t adapt the configure script, edit the head of /usr/share/doc/awstats/examples/awstats_configure.pl to

$AWSTATS_PATH='/usr/share/awstats';
$AWSTATS_ICON_PATH='/usr/share/awstats/icon';
$AWSTATS_CSS_PATH='/usr/share/awstats/css';
$AWSTATS_CLASSES_PATH='/usr/share/awstats/lib';
$AWSTATS_CGI_PATH='/usr/lib/cgi-bin';
$AWSTATS_MODEL_CONFIG='/usr/share/doc/awstats/examples/awstats.model.conf';
$AWSTATS_DIRDATA_PATH='/var/lib/awstats';

Now awstats_configure.pl works!

Because I use apache2, i had to edit /etc/awstats/awstats.yourdomain.com.conf

LogFile="/var/log/apache2/access.log"

Before the awstats-Site is viewable, the perlscript has to be executable by the apache2 user

~# chown www-data /usr/lib/cgi-bin/awstats.pl

That’s it, awstats is up. It has just a minimal configuration, but works. Everybody should read the available documentation, to get awstats with all the features.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.