簡體字、馮|安裝nginx 分析工具 goaccess

下載源碼

#下載
$ wget https://tar.goaccess.io/goaccess-1.5.1.tar.gz
$ tar -xzvf goaccess-1.5.1.tar.gz
$ cd goaccess-1.5.1/

編譯前校驗

  • 安裝中出現異常及解決
$ ./configure --enable-utf8 --enable-geoip=legacy
#安裝geoIp
configure: error: 
    *** Missing development files for the GeoIP library
  
[admin.hq@localhost goaccess-1.5.1]$ yum -y install geoip-devel 
checking for mvaddwstr in -lncursesw... no
configure: error: *** Missing development libraries for ncursesw
[admin.hq@localhost goaccess-1.5.1]$ sudo yum -y install ncurses-devel
  • 安裝成功
# 安裝成功
[admin.hq@localhost goaccess-1.5.1]$ ./configure --enable-utf8 --enable-geoip=legacy
Your build configuration:

  Prefix         : /usr/local
  Package        : goaccess
  Version        : 1.5.1
  Compiler flags :  -pthread
  Linker flags   : -lnsl -lncursesw -lGeoIP -lpthread  
  UTF-8 support  : yes
  Dynamic buffer : no
  Geolocation    : GeoIP Legacy
  Storage method : In-Memory with On-Disk Persistent Storage
  TLS/SSL        : no
  Bugs           : hello@goaccess.io
$ make
$ make install
# make 部分關鍵日志
make[3]: 進入目錄“/home/admin.hq/monitor/goaccess-1.5.1”
 /usr/bin/mkdir -p '/usr/local/bin'
  /usr/bin/install -c goaccess '/usr/local/bin'
 /usr/bin/mkdir -p '/usr/local/etc/goaccess'
 /usr/bin/install -c -m 644 config/goaccess.conf config/browsers.list config/podcast.list '/usr/local/etc/goaccess'
 /usr/bin/mkdir -p '/usr/local/share/man/man1'
 /usr/bin/install -c -m 644 goaccess.1 '/usr/local/share/man/man1'

設置環境變量

  • 跟據make install 路徑視不同情況設置
[admin.hq@localhost ~]$ goaccess -V
GoAccess - 1.5.1.
For more details visit: https://goaccess.io/
Copyright (C) 2009-2020 by Gerardo Orellana

Build configure arguments:
  --enable-utf8
  --enable-geoip=legacy

通過nginx發布web界面

  • 實時生成html文件

通過nginx暴露report.html實時文檔

# /usr/local/nginx/html替換成自己的nginx的html路徑
goaccess access.log -o /usr/local/nginx/html/report.html --log-format=COMBINED --real-time-html &

頁面

ui.png
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容