AWStats setup

If you have a website, then you should also have a way of analyzing its activity. How many unique IP addresses are accessing your domain? Who is linking to your site? Which spiders are most active on your pages? All these questions, and many more, can be answered by using AWStats. Here is how to setup AWStats on Ubuntu for an Apache2 web server:

Install AWStats
apt-get install awstats

Next, locate and edit the following lines in /etc/awstats/awstats.conf
LogFile="/var/log/apache2/access.log"
LogFormat=1
SiteDomain="your_site"
AllowToUpdateStatsFromBrowser=1

Test AWStats with the following command. If you get any errors, correct them before moving on to the next step.
/usr/lib/cgi-bin/awstats.pl -config=your_site

In order to use “AllowToUpdateStatsFromBrowser” the access log permissions must be modified
chmod 644 /var/log/apache2/access.log

To view the images in AWStats, add the following line to /etc/apache2/sites-available/default
Alias /awstats-icon "/usr/share/awstats/icon/"

Restart the web server
apache2 –k restart

You should now be able to access your site’s stats at http://your_site/cgi-bin/awstats.pl

Tags: , , ,

One Response to “AWStats setup”

  1. blake Says:

    Not sure what the problem is but the standard cron entry doesn’t seem to work. Open /etc/cron.d/awstats with a text editor and replace the entry with: 0 0 * * * root /usr/lib/cgi-bin/awstats.pl -config=awstats -update >/dev/null This line of code will cause AWStats to be updated every day at midnight.

Leave a Reply