简体字、冯|安装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           : [email protected]
$ 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

你可能感兴趣的:(简体字、冯|安装nginx 分析工具 goaccess)