Dec 16, 2013
1 min read
May 31, 2023 18:13 EEST

First install the port:


Install awstats configuration:

mkdir /usr/local/etc/awstats
cd /usr/local/etc/awstats
cp /usr/local/www/awstats/cgi-bin/awstats.model.conf .
mkdir /var/lib/awstats
ln -s /usr/local/etc/awstats /etc/awstats

Now edit our standard template /usr/local/www/awstats/cgi-bin/awstats.model.conf:


This file can be copied now to the following names: awstats.<domain>.conf

Make necessary changes in this new file like path for logfile etc.

To generate statistics edit /etc/crontab:

  -  Updatw awstats
30      23      *       *       *       root    /usr/local/www/awstats/tools/ now

Make sure, that you have something like this line in your apache configuration:

CustomLog /home/http/default/logs/custom.log combined

Create a file /usr/local/etc/apache22/awstats.conf:

Alias /awstatsclasses "/usr/local/www/awstats/classes/"
Alias /awstatscss "/usr/local/www/awstats/css/"
Alias /awstatsicons "/usr/local/www/awstats/icons/"
Alias /awstats/ "/usr/local/www/awstats/cgi-bin/"

  -  This is to permit URL access to scripts/files in AWStats directory.
<Directory "/usr/local/www/awstats/">

    Options +ExecCGI
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all
    AuthType Basic
    AuthName stats
    AuthUserFile /usr/local/etc/apache22/htpasswd.awstats
    require valid-user```

To load the file from apache add to the file /usr/local/etc/apache22/httpd.conf the line:

Include /usr/local/etc/apache22/awstats.conf

Now retart apache and go to the URI webside/awstats/.

Related Posts