Skip to content

Instantly share code, notes, and snippets.

@ebta
Last active February 5, 2022 08:26
Show Gist options
  • Save ebta/b55b15557183996a64aa5eebd580a6bf to your computer and use it in GitHub Desktop.
Save ebta/b55b15557183996a64aa5eebd580a6bf to your computer and use it in GitHub Desktop.
Install and Running goaccess on Ubuntu

Installation

Requirements Package

sudo apt install libncursesw5-dev libgeoip-dev libmaxminddb-dev libssl-dev

Build from latest version For example using v1.55 (check on https://goaccess.io/download )

wget https://tar.goaccess.io/goaccess-1.5.5.tar.gz
tar -xzvf goaccess-1.5.5.tar.gz
cd goaccess-1.5.5/
./configure --enable-utf8 --enable-geoip=mmdb
make
make install

Build from GitHub (Development)

git clone https://github.com/allinurl/goaccess.git
cd goaccess
autoreconf -fi
./configure --enable-utf8 --enable-geoip=mmdb
make
make install

Example Usage

Go to the log directory, for example /var/log/nginx or /var/log/apache2/

Terminal Output

goaccess access.log -c

Static HTML Output

goaccess access.log -o report.html --log-format=COMBINED

Using multiple input log

zcat -f access.log.*.gz | goaccess 
zcat access.log.*.gz | goaccess --log-format=COMBINED

Real-Time HTML Output

goaccess access.log -o /var/www/html/report.html --log-format=COMBINED --real-time-html

important

  • You should place your report.html output file under your Web Server document root.
  • You should be able to simply open your report.html by navigating the browser to your document root URL. e.g., http://example.com/report.html
  • GoAccess features its own Web Socket server and that's how it pushes the latest data to the browser.
  • If you don't run a Web Server to host your report.html, you can simply open the output file through your browser (Ctrl+o)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment