GoAccess is a web server log analysis tool that can run both in the terminal and through a web server. GoAccess provides us with real-time detailed information about network traffic, web browsers, geolocation, and other interesting information for the system administrator.
GoAccess can generate an HTML file to view the statistics, but the best way to serve this information is through a mini web server like http-server-with-auth . When we want to access the information, we start the server and when we finish, we turn it off. Additionally, this server supports authentication, so it fits perfectly with our needs.
Depending on the operating system we use, the process may vary slightly.
pkg install npm
emerge -av net-libs/nodejs
Instalamos el servidor de forma global:
Instalamos GoAccess.
pkg install goaccess
emerge -av net-analyzer/goaccess
Creamos el directorio donde generar el html:
cp /usr/local/etc/goaccess.conf .goaccessrc
time-format %H:%M:%S
date-format %d/%b/%Y
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
We start the web server to serve the file generated by GoAccess:
By accessing SERVER_IP:7777 and providing the credentials, we can view the statistics:
When we finish, we stop both GoAccess and the web server.
It is also possible to view the statistics via the terminal, but the web interface is more visually appealing.