1. 程式人生 > >用GoAccess實現視覺化並實時監控access日誌

用GoAccess實現視覺化並實時監控access日誌

1.ubuntu16.04安裝GoAccess

GoAccess下載地址:https://goaccess.io/download

安裝步驟:

$ wget https://tar.goaccess.io/goaccess-1.3.tar.gz
$ tar -xzvf goaccess-1.3.tar.gz
$ cd goaccess-1.3/
$ ./configure --enable-utf8 --enable-geoip=legacy
$ make
# make install

Q1:在執行第四步./configure時,遇到問題:

configure: error: 


*** Missing development files for the GeoIP library

解決方法:

$ wget https://github.com/maxmind/geoip-api-c/releases/download/v1.6.11/GeoIP-1.6.11.tar.gz
$ tar -xzvf GeoIP-1.6.11.tar.gz
$ cd GeoIP-1.6.11
$ ./configure
$ make
# make install

 Q2:在執行第四步./configure時,遇到問題:

configure: error: *** Missing development libraries for ncursesw

解決方法:

要使用--enable-utf8,你需要安裝ncursesw,下面是安裝命令:

sudo apt-get install libncursesw5-dev

 

安裝完成截圖:

 

2.修改nginx伺服器的配置檔案nginx.conf

location /report.html {
            alias /home/zopen/nginx/html/report.html;    #指定個人配置的目錄
        }

如下圖所示:

重新載入配置檔案:

../sbin/nginx -s reload

 

 

3.開啟網站,成功執行!