Installing awstats on Debian system

To see who is visiting your website there is a nice opensource package available called awstats. After installing awstats by the usual command a few extra actions are required. I’ll explain in the rest of these post the required steps for a simple configuration.

apt-get install awstats
sudo chmod a+r /var/log/apache2/*
ln -s /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf.d/awstats
/etc/init.d/apache2 restart

Edit file /etc/logrotate.d/apache2:

  • line ‘create 640 root adm’ into ‘create 644 root adm’

Edit file /etc/awstats/awstats.conf:

  • line LogFile=… into LogFile=”/var/log/apache2/access.log”
  • line LogFormat=… into LogFormat=1

Add to file /etc/awstats/awstats.conf.local:

SiteDomain="www.yourdomain.com"
HostAliases="localhost 127.0.0.1 alternative.yourdomain.com"
SkipFiles="REGEX[awstats|phpmyadmin]"

Edit file /etc/cron.d/awstats into:

0,10,20,30,40,50 * * * * www-data /usr/lib/cgi-bin/awstats.pl -config=www.yourdomain.com -update >/dev/null

After your set with this, check out this page if you’re interested how many visitors you get using the Chrome browser.


linux