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
- Webalizer
- GoAccess
- Splunk
- ...
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