The following is the GNU All-permissive License as ommended in

Copyright (C) 2024 Free Software Foundation

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

Contributions are welcome. See


See cluestick for info setting up on old hosts.

Adding a machine to awstats

Example and IP address is 555.555.555.555

  1. Make a new VM and add it to either the [apache] or [nginx] category of ansible's inventory file.
  2. Login to termite. ssh
  3. Copy a known good config. cp /etc/awstats/ /etc/awstats/
  4. Change the host name. sed -i 's/' vim /etc/awstats/
  5. Change the IP address. sed -i 's/' vim /etc/awstats/
  6. Test your config. /usr/lib/cgi-bin/ -update
  7. Check that your files are in /var/log/vhosts/555.555.555.555/. ls /var/log/vhosts/555.555.555.555/
  8. Edit the webpage to point to your new server. vim /var/www/html/index.html
  9. Exit. exit
  10. Open the page and view your new server stats! :D

On GNU Hope

We don't need logpp, because apache and nginx automatically log to syslog, as long as you are using the logging configuration suggested by ansible. note that changes to web server's site config are not enforced by ansible, so make sure that you have the proper logging config enabled. make sure that you have something like the following.

/etc/syslog-ng/conf.d/00load-fsf-termite.conf is automatically copied to apache and nginx vms.

It needs to be

CustomLog "|/usr/bin/logger -t apache -p" combined

When migrating an old VM, that uses awstats, to a new machine, edit the LogFile directive on in /etc/awstats/, for example, to point to the new log file.


Our Awstats config ignores IPv4 requests that originate from the FSF office.


Awstats glossary:


Before running Awstats commands, ensure that Awstats isn't running. It runs every 10 minutes.

ps -ef | grep -i awstats

If you want to know why some records are ignored by Awstats:

sudo -u www-data /usr/local/awstats-7.6/wwwroot/cgi-bin/ -update -showdropped | less

Also useful:

/usr/local/awstats-7.6/wwwroot/cgi-bin/ -help | less

Cron job:

sudo -u www-data /usr/local/bin/



Robots definition updates

git clone
cd awstats
scp /tmp
meld /tmp/robots.txt

# if there are updates, let know that stats may change.