当前位置:Gxlcms > 数据库问题 > Goaccess 日志分析工具

Goaccess 日志分析工具

时间:2021-07-01 10:21:17 帮助过:17人阅读



1.安装组件

#yum groupinstall ‘Development Tools‘
#yum -y install glib2 glib2-devel ncurses ncurses-devel GeoIP GeoIP-devel
#yum -y install nginx


2.下载源码包安装

#wget http://tar.goaccess.io/goaccess-1.0.1.tar.gz

#tar xf goaccess-1.0.1.tar.gz 
#cd goaccess-1.0.1/
#./configure --prefix=/usr/local/goaccess
#make && make install


3.编辑文件
vim /usr/local/goaccess/etc/goaccess.conf 
去除下面13,33行的注释,增加235行的注释

13 time-format %H:%M:%S

36 date-format %d/%b/%Y
65 log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
412 #ignore-panel KEYPHRASES

4.添加goaccess二进制程序


vim /etc/profile.d/goaccess.sh

export PATH=$PATH:/usr/local/goaccess/bin/创建网页目录
mkdir /log
生成网页报告
goaccess -f access.log -d -a  > /log/access.html

5.Nginx发布goaccess网页

cd /etc/nginx/conf.d/

vim goaccess.conf
server {
        listen 80;
        server_name goaccess.cw.com;
        autoindex on;
        location / {
            root   /log;
        }
}

6.启动nginx
service nginx start
7.访问网页
http://goaccess.cw.com/access.html

本文出自 “曾經的味道” 博客,请务必保留此出处http://584014981.blog.51cto.com/8605371/1790302

Goaccess 日志分析工具

标签:goaccess

人气教程排行