summaryrefslogtreecommitdiff
path: root/GoAccess.md
blob: b0794696c34d2b3b2017a34c75c5637bb232191b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# GoAccess – HTTP log monitoring for OpenBSD

This guide sets up GoAccess to analyse httpd(8) access logs in real time via a
simple HTML report. The report is updated from a cron job and served by the
same web server.

## Installation

```bash
doas pkg_add goaccess

Collect logs for a specific domain

Assume logs for your_domain are stored in /var/www/logs/access.log.
Create a report directory and generate the first report:
bash

doas mkdir -p /var/www/htdocs/you_www/stats
doas goaccess /var/www/logs/you_www.log -o /var/www/htdocs/you_www/stats/index.html --log-format=COMBINED
doas chown -R www:www /var/www/htdocs/report

doas chown -R www:www /var/www/htdocs/drohiczyn-poleski/stats
doas chmod 755 /var/www/htdocs/drohiczyn-poleski/stats

Automatic daily update with cron

Add the following line to root's crontab (doas crontab -e):
text

0 * * * * /usr/local/bin/goaccess /var/www/logs/you_www/.log -o /var/www/htdocs/you_www//stats/index.html >/dev/null 2>&1

Now visit https://your_domain/report/ to see the statistics.