整理時点は 2026-04-29 です。
現時点で公式 README に載っている最新安定版は 1.10.2 です。
1. まずビルド依存を入れる
1
2
3
|
sudo apt-get update
sudo apt-get install -y build-essential wget tar \
libncurses-dev libmaxminddb-dev libssl-dev zlib1g-dev
|
2. 最新ソースパッケージを取得する
1
2
3
4
|
cd /usr/local/src
sudo wget https://tar.goaccess.io/goaccess-1.10.2.tar.gz
sudo tar -xzvf goaccess-1.10.2.tar.gz
cd goaccess-1.10.2
|
3. ビルドオプションを設定する
1
|
sudo ./configure --enable-utf8 --enable-geoip=mmdb --with-zlib
|
リアルタイムHTMLレポートで TLS も使いたいなら、こちらでもよいです。
1
|
sudo ./configure --enable-utf8 --enable-geoip=mmdb --with-zlib --with-openssl
|
4. ビルドしてインストールする
1
2
|
sudo make
sudo make install
|
5. バージョンを確認する
1
2
|
goaccess --version
which goaccess
|
6. 端末でそのままレポートを見る
Nginx や Apache の一般的な combined ログなら、まずはこれでよいです。
1
|
goaccess /var/log/nginx/access.log --log-format=COMBINED
|
Apache のログパスならこちらです。
1
|
goaccess /var/log/apache2/access.log --log-format=COMBINED
|
7. 静的な HTML レポートを生成する
1
2
3
4
|
goaccess /var/log/nginx/access.log \
--log-format=COMBINED \
-a \
-o /usr/share/nginx/html/goaccess-report.html
|
カレントディレクトリに出しても構いません。
1
2
3
4
|
goaccess /var/log/nginx/access.log \
--log-format=COMBINED \
-a \
-o report.html
|
8. リアルタイム HTML レポートを生成する
1
2
3
4
5
|
goaccess /var/log/nginx/access.log \
--log-format=COMBINED \
-a \
-o /usr/share/nginx/html/goaccess-report.html \
--real-time-html
|
ポートを変えるなら:
1
2
3
4
5
6
|
goaccess /var/log/nginx/access.log \
--log-format=COMBINED \
-a \
-o /usr/share/nginx/html/goaccess-report.html \
--real-time-html \
--port=7891
|
ローカルホストだけにバインドするなら:
1
2
3
4
5
6
|
goaccess /var/log/nginx/access.log \
--log-format=COMBINED \
-a \
-o /usr/share/nginx/html/goaccess-report.html \
--real-time-html \
--addr=127.0.0.1
|
9. ログを追い続ける
1
|
tail -f /var/log/nginx/access.log | goaccess --log-format=COMBINED -
|
ファイル先頭から読んで、そのままリアルタイムで追うなら:
1
2
3
4
|
tail -f -n +0 /var/log/nginx/access.log | goaccess \
--log-format=COMBINED \
-o report.html \
--real-time-html -
|
10. 特定のリクエストだけを見る
たとえば firefox を含むリクエストだけ:
1
2
|
tail -f /var/log/nginx/access.log | grep -i --line-buffered 'firefox' | goaccess \
--log-format=COMBINED -
|
たとえば 5xx と 3xx だけ:
1
2
3
|
tail -f -n +0 /var/log/nginx/access.log | awk '$9~/3[0-9]{2}|5[0-9]{2}/' | goaccess \
--log-format=COMBINED \
-o out.html -
|
11. 複数ログをまとめて解析する
1
|
goaccess /var/log/nginx/access.log /var/log/nginx/access.log.1 --log-format=COMBINED
|
圧縮済みと未圧縮をまとめて読むなら:
1
|
zcat --force /var/log/nginx/access.log* | goaccess --log-format=COMBINED -
|
12. マルチスレッドを使う
1
2
3
4
|
goaccess /var/log/nginx/access.log \
--log-format=COMBINED \
-o report.html \
-j 4
|
chunk を大きくするなら:
1
2
3
4
5
|
goaccess /var/log/nginx/access.log \
--log-format=COMBINED \
-o report.html \
-j 4 \
--chunk-size=8192
|
13. 増分処理
まず古いログを永続化しておく:
1
|
goaccess /var/log/nginx/access.log.1 --log-format=COMBINED --persist
|
次に現在のログを追加する:
1
|
goaccess /var/log/nginx/access.log --log-format=COMBINED --restore --persist
|
永続化済みデータだけを読む:
14. 自分なら最初に流すコマンド
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
sudo apt-get update
sudo apt-get install -y build-essential wget tar \
libncurses-dev libmaxminddb-dev libssl-dev zlib1g-dev
cd /usr/local/src
sudo wget https://tar.goaccess.io/goaccess-1.10.2.tar.gz
sudo tar -xzvf goaccess-1.10.2.tar.gz
cd goaccess-1.10.2
sudo ./configure --enable-utf8 --enable-geoip=mmdb --with-zlib --with-openssl
sudo make
sudo make install
goaccess --version
goaccess /var/log/nginx/access.log \
--log-format=COMBINED \
-a \
-o /usr/share/nginx/html/goaccess-report.html \
--real-time-html
|
だいたいこれで十分です。
やることが明確なら、最新版をソースから入れて、まず --log-format=COMBINED と --real-time-html を通すところまで進めれば、あとはログパス、出力先、ポートを調整していくくらいです。