centos7 源码安装goaccess

centos7 源码安装goaccess,第1张

centos7 源码安装goaccess

1. 使用yum安装在不同服务器上可能失败, 推荐使用源码安装goaccess

# 安装依赖
yum install -y ncurses-devel GeoIP-devel.x86_64 tokyocabinet-devel openssl-devel # 下载源码包并安装
cd /usr/local/software
wget http://tar.goaccess.io/goaccess-1.3.tar.gz
tar -xvf goaccess-1.3.tar.gz -C /usr/local/
cd /usr/local/
./configure --enable-utf8 --enable-geoip=legacy
make & 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. 浏览器访问

参考:

  https://my.oschina.net/mrco/blog/181737

  https://yq.aliyun.com/articles/695263

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/589141.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-12
下一篇 2022-04-12

发表评论

登录后才能评论

评论列表(0条)

保存