Complete Virtual Mail Server/awstats

Introduction
Even though postfix provides logs, having them graphically displayed and analyzed can give much more insight. is a popular log analyzer that can parse logs and setup proper results.

Installation
AWStats is a web-application but no longer relies on webapp-config. If it hasn't emerged already, it needs to be emerged.

Once installed, a config file needs to be created, either per domain, or one that handles all domains.

AWStats
AWStats comes with reasonable defaults, but some need to be changed nevertheless.

For one, awstats assumes that vhosts aren't used. When using apache's default combined vhost logs for example, awstats will fail to run.

Assuming apache's combined LogFormat is setup as follows. LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" VLOG=%{VLOG}e" vhost

The following changes needs to be made.

Next awstats needs to know about the domains and aliases to filter from the log file.

Also, awstats needs to store its database somewhere. Gentoo has created /var/lib/awstats for this use, but can be stored anywhere.

Any other changes to the configuration file are optional, but interesting to look into.

Logrotate
AWStats is normally used as an analyzer of web server logs, mostly Apache.