> ## Content Index
> Fetch the complete content index at: https://suitmyself.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Ubuntu 20.04에 GoAccess 웹 로그 분석기를 설치하는 방법
- URL: https://suitmyself.com/ubuntu-20-04e-goaccess-web-rogeu-bunseoggireul-seolcihaneun-bangbeob/
- Published: 2023-05-06T07:48:00.000Z
- Updated: 2023-05-06T07:48:00.000Z
- Author: Benjamin Kim
- Tags: Server, ubuntu, #Import 2026-09-15 05:58

## 시작

```bash
sudo apt-get update -y

```

### 1\. Source를 다운받아 설치하기

기본적으로 GoAccess는 Ubuntu 기본 리포지토리에 포함되어 있지 않다. 따라서 시스템에 GoAccess 저장소를 추가하거나 소스를 다운받아 설치해야 한다.

현재 1.5.4 가 stable 버젼으로 다음을 참고하여 우선적을 필요한 것들을 먼저 설치한다.

```bash
apt-get install libncursesw5-dev libgeoip-dev libtokyocabinet-dev build-essential -y

```

모든 필요 항목이 설치되면 다음 명령을 사용하여 GoAccess 소스를 다운로드 후 압축을 해제하고 설치한다.

```bash
$ wget https://tar.goaccess.io/goaccess-1.5.4.tar.gz
$ tar -xzvf goaccess-1.5.4.tar.gz
$ cd goaccess-1.5.4/
$ ./configure --enable-utf8 --enable-geoip=mmdb

```

```
...
checking for MMDB_open in -lmaxminddb... no
configure: error:  
    *** Missing development files for libmaxminddb library.

```

위와 같은 에러 발생시에는 다음의 방법으로 라이브러리를 추가 설치한 후  
`./configure --enable-utf8 --enable-geoip=mmdb` 명령을 재 실행 한다.

```bash
sudo apt-get update -y
sudo apt-get install -y libmaxminddb-dev

```

```bash
..........
..........
..........
Your build configuration:

  Prefix         : /usr/local
  Package        : goaccess
  Version        : 1.5.4
  Compiler flags :  -pthread
  Linker flags   : -lnsl -lncursesw -lmaxminddb -lpthread  
  UTF-8 support  : yes
  Dynamic buffer : no
  Geolocation    : GeoIP2
  Storage method : In-Memory with On-Disk Persistent Storage
  TLS/SSL        : no
  Bugs           : hello@goaccess.io

```

위와 같이 나오면 `make` 명령을 이용하여 설치한다.

```bash
$ make
# make install

```

```bash

```

완료되면 아래 명령으로 설치 버젼을 확인한다.

```bash
$ goaccess --version

```

다음 명령을 사용하여 GoAccess 기본 config 파일을 찾을 수 있다.

```bash
$ goaccess --dcf
/usr/local/etc/goaccess/goaccess.conf

```

터미널을 열고 다음 명령을 사용하여 GoAccess 대시보드를 시작한다.

```bash
$ goaccess /var/log/apache2/access.log --log-format=COMBINED

```

![p1](https://suitmyself.com/content/images/2023/05/p1.png)

다음 키보드 단축키를 사용하여 인터페이스를 탐색할 수 있다.

```
F5 : 대시보드를 새로 고칠 때 사용합니다.
G : 대시보드의 마지막 항목으로 이동할 때 사용하며, g를 사용하여 대시보드 상단으로 이동합니다.
j, k : 상하로 스크롤 할 때 사용합니다.
s : 활성 모듈에 대한 정렬 옵션을 표시하는 데 사용됩니다.
? : 도움말 정보를 표시하기 위해 사용합니다.
TAB : 앞으로 이동할 때 사용합니다.
q : 프로그램을 종료할 때 사용합니다.

```

이제 1 을 눌러 아래와 같이 순 방문자수, 대역폭 및 일일 총 조회수를 표시한다.

![002_a1](https://suitmyself.com/content/images/2023/05/002_a1.png)

2 를 눌러 아래와 같이 웹 서버에서 가장 많이 요청된 비정적 파일을 표시합니다.

![003-a2](https://suitmyself.com/content/images/2023/05/003-a2.png)

3 을 누르면 아래와 같이 이미지, CSS, JavaScript와 같은 정적 파일에 대한 정보가 표시된다.

![004-a3](https://suitmyself.com/content/images/2023/05/004-a3.png)

4 를 눌러 아래와 같이 URL을 찾을 수 없는 경로를 표시한다.

![005-a4](https://suitmyself.com/content/images/2023/05/005-a4.png)

5 를 누르면 아래와 같이 방문자의 호스트 이름과 IP 주소가 표시됩니다.

![006-a5](https://suitmyself.com/content/images/2023/05/006-a5.png)

6 을 누르면 아래와 같이 호스트에서 사용하는 운영 체제 정보가 표시됩니다.

![007-a6](https://suitmyself.com/content/images/2023/05/007-a6.png)

7 을 누르면 아래와 같이 순 방문자별 정보가 표시됩니다.

![008-a7](https://suitmyself.com/content/images/2023/05/008-a7.png)

8 을 누르면 조회수, 순 방문자수, 소비된 대역폭에 대한 시간별 정보가 아래와 같이 표시됩니다.  
![009-a8](https://suitmyself.com/content/images/2023/05/009-a8.png)

---

## HTML 보고서 생성

또한 GoAccess를 사용하면 HTML, JSON 또는 CSV 보고서를 생성하고 웹 브라우저를 통해 액세스할 수 있습니다.

다음 명령으로 생성할 수 있습니다.

```bash
goaccess /var/log/apache2/access.log --log-format=COMBINED -a -o /var/www/html/report.html

```

이제 웹 브라우저를 열고 URL [http://your-server-ip/report.html](http://your-server-ip/report.html?ref=suitmyself.com) 을 사용하여 생성된 보고서에 액세스합니다.

다음 페이지가 표시되어야 합니다.

![009-p3](https://suitmyself.com/content/images/2023/05/009-p3.png)

goaccess -f access.log --log-format='%\]% %h:%^ \[%d:%t.%^\] %/%/%/%/%L/%^ %s %b %^"%r"' --date-format='%d/%b/%Y' --time-format='%H:%M:%S'