CentOS安装goaccess

yum install ncurses-devel
安装ncurses依赖
按Y确认

wget http://tar.goaccess.io/goaccess-1.2.tar.gz
下载安装包

tar -xzvf goaccess-1.2.tar.gz
解压

cd goaccess-1.2
进入goaccess-1.2目录

./configure --enable-utf8 --enable-geoip --legacy
配置选项

make
编译

make install
安装

goaccess -V
查看版本

goaccess /var/log/nginx/access.log
在任意目录执行

请注意,
这个界面是按空格键选择,
然后按Enter键确认!

这个界面是按Tab键选择,
按Q退出!

vim /usr/local/etc/goaccess.conf
编辑配置文件

第13行去掉#号
time-format %H:%M:%S

第36行去掉#号
date-format %d/%b/%Y

第64行去掉#号
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"

第269行去掉#号
port 7890

第273行去掉#号
real-time-html true

第381行去掉#号
修改为
output-format /var/www/html/nginxlog/index.html


mkdir /var/www/html/nginxlog
在Apache的html目录下创建nginxlog目录

firewall-cmd --zone=public --permanent --add-port=7890/tcp
firewall-cmd --reload
开放防火墙7890端口

goaccess /var/log/nginx/access.log
开启goaccess

访问http://192.168.1.13:8989/nginxlog/

猜你喜欢

转载自www.cnblogs.com/yjlch1016/p/9102894.html