Installing

mod_perl

Awstats

Awstats package is available in AUR. You can use yaourt to build it or you can obtain tarball from AUR and build it yourself.

$ yaourt -S awstats

Configuring

Enable mod_perl for Apache

To enable Template:Codeline in apache, you should add following line to apache configuration (/etc/httpd/conf/httpd.conf).

LoadModule perl_module modules/mod_perl.so

Configure Apache to log for Awstats

By default awstats requires Apache to record access logs as 'combined'. Unless you want a different behavior, you should set your access log format as 'combined'. To do so, your apache configuration should look like this:

Warning: At this point, if apache has started to log access with different format, awstats will complain about this because it can't read. So if you are changing apache's log format now, you probably should delete old log files not to confuse Awstats.

Including Awstats Configuration to Apache's Configuration

If you set the log format, then next step is including awstats config file to apache. The package in AUR has a default one, and it's working without any problem. But incase you want to create your own configuration, default one is this:

One last thing, which is the actual aim, make awstats read logs and convert them to stats.

Awstats Configuration

Package in AUR comes with a out of the box hourly cron to update stats shown on awstats. This cron script reads awstats configuration files in Template:Codeline and updates the stats for the sites that are defined in these configuration files. Instead of creating these configuration files, you can use awstats' configuration tool. Run:

perl /usr/share/awstats/tools/awstats_configure.pl

and follow the instructions. If you are successfully created config file there is one thing that you should modify manually. Open the configuration file created by Template:Codeline with your favorite text editor. Then find the line on which Template:Codeline variable is defined, and set it as the path that apache logs accesses (which you set to be logged as 'combined' format before):

LogFile=/var/log/httpd/returnfalse-access_log

You are done, now you can run hourly cron script to test the results.

Remember: With these settings anyone will be able to reach awstats. Setting a authentication would help keeping these stats private.