3 ms·
I don't know if many still use it but AWStats [1][2] is one of the oldest self hosted solutions. I used it ages ago. It uses access logs vs. other platforms d
by LinuxBender 4y ago
I don't know if many still use it but AWStats [1][2] is one of the oldest self hosted solutions. I used it ages ago. It uses access logs vs. other platforms depending on javascript being embedded in pages. It's had some vulnerabilities in the past so it should be protected by authentication. It depends on Perl and a web server that supports CGI scripts. Stats processing is done in cron against the access logs so there is no added load based on page visits. It could even be run on a separate machine/node that logs are aggregated to.
Part of the installation is configuring which log format your servers use. If using a non standard format one can map the related fields.
If configuring AWStats to perform reverse DNS lookups I would suggest also installing Unbound DNS specifically on that machine and setting the following in /etc/unbound/unbound.conf to minimize load on your upstream servers perhaps even higher:
cache-min-ttl: 86400
cache-max-ttl: 1209600
serve-expired: yes
serve-expired-ttl: 259200
serve-expired-reply-ttl: 30
serve-expired-ttl-reset: yes
val-bogus-ttl: 600
cache-max-negative-ttl: 86400
serve-expired-client-timeout: 1800
The above is specifically for machines dedicated to looking up a very large number of PTR records, not for a home router. Some DNS providers rate limit mass-lookups of IP addresses. PTR records are slow to change so a high TTL override on a log processing box is generally fine unless you care about short lived PTR records AWS, Azure, etc..
[1] - https://awstats.sourceforge.io/ https://awstats.sourceforge.io/
[2] - https://github.com/eldy/AWStats https://github.com/eldy/AWStats