首页 技术 正文
技术 2022年11月16日
0 收藏 882 点赞 2,208 浏览 1361 个字

1.ubuntu16.04安装GoAccess

GoAccess下载地址:https://goaccess.io/download

安装步骤:

$ wget https://tar.goaccess.io/goaccess-1.3.tar.gz
$ tar -xzvf goaccess-1.3.tar.gz
$ cd goaccess-1.3/
$ ./configure --enable-utf8 --enable-geoip=legacy
$ make
# make install

Q1:在执行第四步./configure时,遇到问题:

configure: error: 
*** Missing development files for the GeoIP library

解决方法:

$ wget https://github.com/maxmind/geoip-api-c/releases/download/v1.6.11/GeoIP-1.6.11.tar.gz
$ tar -xzvf GeoIP-1.6..tar.gz
$ cd GeoIP-1.6.
$ ./configure
$ make
# make install

 Q2:在执行第四步./configure时,遇到问题:

configure: error: *** Missing development libraries for ncursesw

解决方法:

要使用–enable-utf8,你需要安装ncursesw,下面是安装命令:

sudo apt-get install libncursesw5-dev

安装完成截图:

Nginx系列4:用GoAccess实现可视化并实时监控access日志

2.修改nginx服务器的配置文件nginx.conf

location /report.html {
alias /home/zopen/nginx/html/report.html;    #指定个人配置的目录
}

如下图所示:

Nginx系列4:用GoAccess实现可视化并实时监控access日志

重新加载配置文件:

../sbin/nginx -s reload

Nginx系列4:用GoAccess实现可视化并实时监控access日志

3.执行goaccess命令,在nginx/logs目录下,执行:

goaccess access.log -o ../html/report.html --real-time-html --time-format='%H:%M:%S'  --date-format='%d/%b/%Y' --log-format=COMBINED

打开网站,成功运行!

Nginx系列4:用GoAccess实现可视化并实时监控access日志

4.后台运行GoAccess

打开 Tmux 并启动 GoAccess

$ tmux
$ goaccess access.log -o ../html/report.html --real-time-html --time-format='%H:%M:%S' --date-format='%d/%b/%Y' --log-format=COMBINED

一切正常的话 GoAccess 应该开始分析日志文件了,然后显示 “WebSocket server ready to accept new client connections”。
现在按下你 Tmux 的 PREFIX 键(默认是 Ctrl+B),再按 d 从 Tmux 中脱离出来,这样即使 ssh 断开连接了也能保持后台运行,想查错也可以用

$ tmux attach

连接刚才那个会话。
现在用浏览器打开 http://114.116.120.230:8080/report.html 应该就可以看见分析结果了,每秒钟刷新一次数据。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,956
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,480
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,327
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,110
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,741
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,776