Skip to content

GGOACCESS

Goaccess is a great tool for visually seeing what is in your httpd server logs.

GOACCESS CONFIG

  • Edit for pagename.
  • Edit for log, debug and html file paths
  • Fix root:root ownership if need be

Strip comments off stock file:

grep -o '^[^#]*' /etc/goaccess.conf > ~/goaccess.conf.stripped

Raw file contents:

date-format %d/%b/%Y
log-format COMBINED
config-dialog false
hl-header true
html-report-title Schotty.com Apache Stats Report
json-pretty-print false
no-color false
no-column-names false
no-csv-summary false
no-progress false
no-tab-scroll false
with-mouse true
log-file /var/log/httpd/access_log
debug-file /var/log/goaccess-debug.log
agent-list false
with-output-resolver false
http-method yes
http-protocol yes
output-format /var/www/html/goaccess.html
no-query-string false
no-term-resolver false
444-as-404 false
4xx-to-unique-count false
all-static-files false
double-decode false
ignore-crawlers false
crawlers-only false
process-and-exit false
real-os true
static-file .css
static-file .js
static-file .jpg
static-file .png
static-file .gif
static-file .ico
static-file .jpeg
static-file .pdf
static-file .txt
static-file .csv
static-file .zip
static-file .mp3
static-file .mp4
static-file .mpeg
static-file .mpg
static-file .exe
static-file .swf
static-file .woff
static-file .woff2
static-file .xls
static-file .xlsx
static-file .doc
static-file .docx
static-file .ppt
static-file .pptx
static-file .iso
static-file .gz
static-file .rar
static-file .svg
static-file .bmp
static-file .tar
static-file .tgz
static-file .tiff
static-file .tif
static-file .ttf
static-file .flv

SYSTEMD UNITFILE

The systemd unitfile below should be saved as /etc/systemd/system/goaccess.service. Edit the RestartSec parameter for less/more frequent updates. Below is an update a minute.

[Unit]
Description=Goaccess Apache Log Viewer
After=httpd.service

[Service]
User=root
Restart=always
RestartSec=60
ExecStart=/usr/bin/goaccess -p /etc/goaccess/goaccess.conf -o /var/www/html/goaccess.html

[Install]
WantedBy=multi-user.target

ENABLE UNIT

The following three commands make it work, turns it on at boot, and turns it on now

systemctl daemon-reload
systemctl enable goaccess
systemctl start goaccess