Linux GoAccess 安装使用

拥有回忆 提交于 2020-01-24 22:03:18

1. 使用yum 安装

yum install glib2 glib2-devel GeoIP-devel  ncurses-devel zlib zlib-develyum install gcc -y
yum -y install GeoIP-update
yum install goaccess

2.修改/etc/nginx/nginx.conf文件的日志存储格式

log_format  main  '$remote_addr $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '$http_user_agent $http_x_forwarded_for $request_time $upstream_response_time $upstream_addr $upstream_status';

3.测试生成页面
 

#goaccess -f Nginx access.log目录 -c -a > nginx默认目录
goaccess -f /tmp/nginx/log/access.log -c -a > /tmp/nginx/html/go.html
#后台实时生成数据到goaccess页面
#goaccess -f Nginx access.log目录 -o > nginx默认目录 --real-time-html &
goaccess /tmp/nginx/log/access.log -o /tmp/nginx/html/go.html  --real-time-html &

4.访问界面

其他文章:

详解使用GoAccess分析Nginx的日志  https://www.linuxidc.com/Linux/2016-07/133623.htm
使用GoAccess分析Nginx的Virtual Host日志记录  https://www.linuxidc.com/Linux/2016-07/133622.htm
CentOS 6.5下使用GoAccess工具分析Nginx网站日志 https://www.linuxidc.com/Linux/2017-09/147131.htm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!