The default install options are pretty good for standard usage but for advanced one, you need to go to the compilation
option...
You will have to install some dependencies first.
sudo apt install libncursesw5-dev libglib2.0-dev libgeoip-dev libtokyocabinet-dev libbz2-dev libssl1.0-dev
Check the latest release here: https://goaccess.io/release-notes then download the required files.
wget https://tar.goaccess.io/goaccess-1.3.tar.gz
tar -xzvf goaccess-1.3.tar.gz
cd goaccess-1.3/
# Change '--enable-tcb' according to your needs (memhash|btree)
./configure --enable-utf8 --enable-geoip=legacy --enable-tcb=btree --with-openssl
# This will use all available cpu cores
# It may fail if 'nproc' is not installed use 'make' only instead
make -j $(nproc)
# Install GoAccess on the system
sudo make install
At the time of this writing the latest version is
1.3
.I'm gonna use
btree
TCB storage because my devices have low memory, usememhash
instead.See download page for more options and detailed instructions.
In order to make the realtime
mode working correctly, we need to open the WebSocket
port used by GoAccess
.
# Add new rule
sudo ufw allow 7890 comment "GoAccess"
# Display active rules
sudo ufw status numbered
I'm using
ufw
as firewall manager.
I'm gonna use the realtime
mode only, for other running modes, you will have to read the documentation or at least the Get Started section.
sudo goaccess /var/log/apache2/access.log -a -o /var/www/html/report.html --log-format=COMBINED --real-time-html --html-report-title="GoAccess Report"
You can change the title for something more specific if you prefer.
Use
--anonymize-ip
to protect visitor IP addresses for example.
It should return and wait with:
WebSocket server ready to accept new client connections
If you need to run GoAccess
on terminal before run it in realtime
mode, you can do it that way:
sudo goaccess /var/log/apache2/access.log -a --log-format=COMBINED
You can use the following command line arguments to get a better output:
--real-os
: Display real OS names.--anonymize-ip
: Anonymize the client IP address.
Feel free to comment here if you have any suggestions or correction to provide! 😄
You can reach me on Twitter by using @Jiab77.