1. 使用yum安装在不同服务器上可能失败, 推荐使用源码安装goaccess
# 安装依赖yum install -y ncurses-devel GeoIP-devel.x86_64 tokyocabinet-devel openssl-devel# 下载源码包并安装cd /usr/local/softwarewget http://tar.goaccess.io/goaccess-1.3.tar.gztar -xvf goaccess-1.3.tar.gz -C /usr/local/cd /usr/local/./configure --enable-utf8 --enable-geoip=legacymake & make install# 将goaccess 执行程序关联到系统find / -name 'goaccess' ln -s /usr/local/goaccess-1.3/goaccess /usr/bin # 使用goaccess监控 goaccess /var/log/nginx/access.log -o /usr/local/nginx/html/report.html --real-time-html --time-format='%H:%M:%S' --date-format='%d-%b-Y' --log-format=COMBINED
2. 配置nginx.conf, 使用浏览器访问
# goaccess 日志分析 server { listen 83; server_name 196.128.1.1; location / { root html; index report.html; } }
3. 浏览器访问
参考: