Logs analyzers

Logs analyzers can analyze Apache logs or other webservers and provide reports about stuff like:

  • πŸ’Ž URLs with the most visits
  • πŸ›£οΈ Referring URLs (The URL a visitor was on before coming to your site)
  • 🌍 Visitor geography statistics (IP geolocation...)
  • πŸ”₯ HTTP response codes (e.g., 200, 404) for URLs
  • πŸ•’ Time spent on pages
  • πŸ’» Devices, browsers, and operating systems used by visitors
  • πŸš€ The fastest or 🐒 the slowest loading pages
  • ...

Some log analyzers


AWStats

Advanced Web Statistics (0.3k ⭐, AWStats) is an open-source log file analyzer supporting many log formats.

$ sudo apt-get install htmldoc
$ wget https://prdownloads.sourceforge.net/awstats/awstats-7.8.tar.gz
$ sudo mkdir /usr/local/awstats
$ sudo mv awstats-7.8/* /usr/local/awstats

You need to generate config files:

$ cd /usr/local/awstats/
$ # Possible answers:
$ # none, yes, website_URL_or_name, /etc/awstats
$ ./tools/awstats_configure.pl
$ cat /etc/awstats/awstats.website_URL_or_name.conf

Before generating a report, you need to update the database:

$ sudo perl wwwroot/cgi-bin/awstats.pl -config=website_URL_or_name -update

To generate a report (ex: for every month of 2020):

$ sudo perl /usr/local/awstats/tools/awstats_buildstaticpages.pl -config=website_URL_or_name -month=all -year=2020 -dir=/tmp/ -buildpdf=/usr/bin/htmldoc
$ xdg-open /tmp/awstats.website_URL_or_name.pdf