goaccess实现可视化监控nginx日志

1.下载nginx

配置epel源

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

Yum -y intall nginx

开启nginx

2.Goaccess

安装依赖

yum -y install glib2 glib2-devel ncurses ncurses-devel GeoIP GeoIP-devel gcc gcc-c++

tar zxf goaccess-1.4.tar.gz

./configure --enable-utf8 --enable-geoip-mmdb

make install && make

goaccess /var/log/nginx/access.log

 

cd /usr/share/nginx/html/

mkdir wendi 

goaccess //var/log/nginx/access.log -o /usr/share/nginx/html/wendi/index.html --real-time-html --time-format='%H:%M:%S' --date-format='%d/%b/%Y' --log-format=COMBINED

 

 

原文地址:https://www.cnblogs.com/wendyluo/p/13324852.html