GoAccess - Apache2 Log Analyzer
I use GoAccess to generate reports for my web server. Following are the steps to get it running:
Per GoAccess installation instructions:
$ wget https://tar.goaccess.io/goaccess-1.9.3.tar.gz $ tar -xzvf goaccess-1.9.3.tar.gz $ cd goaccess-1.9.3/ $ ./configure --enable-utf8 --enable-geoip=mmdb $ make $ make installDownload latest GeoIP2 database from MaxMind. You need a free account with MaxMind. The download contains 3 databases:
GeoLite2-City.mmdbGeoLite2-Country.mmdb1GeoLite2-ASN.mmdb
Place downloaded files in
/usr/local/share/GeoIP/.2
Edit GoAccess configuration file
/usr/local/etc/goaccess/goaccess.conf. Make sure these lines are uncommented:log-format COMBINED enable-panel GEO_LOCATIONAdd the following lines:
geoip-database /usr/local/share/GeoIP/GeoLite2-City.mmdb geoip-database /usr/local/share/GeoIP/GeoLite2-ASN.mmdbEdit crontab (
sudo crontab -e) to add:0 1 * * * (cd /var/log/apache2 && zcat access.log.*.gz | goaccess access.log access.log.1 - -o report.html)Translation: every day at 01:00 pipe all compressed logs (
zcat) and uncompressed ones throughgoaccessand generatereport.htmloutput file.