awstats

Why?

server stats are important

The quality of your website also happens to depend on the number of mistakes they have. A professional website is supposed to have less dead links for example. Search engines use information like this to rank your site. It is also good to know which specific pages are the most frequently visited on your site:

  • optimize your content to fit the expectations of your audience
  • never ever delete a page which is frequently visited, also known as the Cool URIs don’t change-rule.

compared to other tools

Compared to the popular and fast webalizer, which is written in C and requires little dependencies awstats has a few advantages:

  • displays a list of error 404: file not found, so it can be used to locate dead links (my personal killer feature in this comparison)
  • is written in perl and is expandable via perl modules. Perl is a good choice since regular expressions are a language feature and can easily be used
  • looks nicer and can be further tweaked by using plugins
  • better maintained

How?

Under FreeBSD files are typically located under /usr/local/www/awstats/. Depending on the webserver you use this location does not really matter when aliases are used.

Configuration

A minimalistic configuration might look like this…

step 1: Take the model file as an example for an configuration and cusomize the following 5-6 lines:
and save the file the file in that cgi-bin-folder and under a new name, but use the form awstats.[entwicklerseite.de].conf or it won’t work.
step 2: create the directory for incrementall data (that way the stats can be updated more quickly):
step 3 (optional): visit your stats and update them
visit [entwicklerseite.de]/awstats/awstats.pl?config=[entwicklseite.de]. That way you can use one installation to log all your subdomains for example by providing a config file for each of those.
step 4 (optional): use cron to update your stats
and restart cron with /etc/rc.d/cron restart

Troubleshooting

No stats: Every number is a 0
This has propably to do with the LogFormat you specified. It is annoying, but is has to match exactly the number of fields per line
Generally:
Execute /usr/local/www/awstats/cgi-bin/awstats.pl -config=entwicklerseite.de from the shell and see what it says.
Especially for 1&1 log files I was able to use:
max,