GoAccess日志分析工具的配置

本文介绍了在CentOS 7系统上,搭配Nginx web服务器,如何配置和使用GoAccess进行日志分析。文章详细阐述了从关闭防火墙和SELinux,到设置阿里源,安装依赖,编译安装GoAccess,直至最后配置并查看页面的完整过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

GoAccess是一款在web页面展示的日志分析工具,页面十分酷炫
我的配置环境是:OS:CentOS 7 web server:Nginx
配置步骤:
1、关闭防火墙和selinux

[root@www ~]# iptables  -X
[root@www ~]# iptables  -F
[root@www ~]# iptables  -Z
[root@www ~]# systemctl disable firewalld 
[root@www ~]# 
[root@www ~]# setenforce 0  
setenforce: SELinux is disabled
[root@www ~]# 

2、配置阿里源的yum仓库

[root@www yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
--2019-03-29 13:17:59--  http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 116.211.153.233, 116.211.153.231, 116.211.153.232, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|116.211.153.233|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[============================================================================>] 2,523       --.-K/s   in 0s      

2019-03-29 13:17:59 (130 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2523/2523]
[root@www yum.repos.d]# vim CentOS-Base.repo 
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/os/$basearch/


[root@www yum.repos.d]# yum repolist all 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
jyy                                                                                            | 3.6 kB  00:00:00     
(1/2): jyy/primary_db                                                                          | 2.8 MB  00:00:00     
(2/2): jyy/group_gz                                                                            | 155 kB  00:00:00     
repo id                                repo name                                                       status
base/x86_64                            CentOS-7 - Base - mirrors.aliyun.com                            enabled: 10,019
jyy                                    jyy                                                             enabled:  3,723
repolist: 13,742
[root@www yum.repos.d]# 

3、安装编译GoAccess时所需要的软件包

[root@www goaccess-0.9.8]# yum install gcc gcc-c++ -y 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-36.el7 will be installed
--> Processing Dependency: cpp = 4.8.5-36.el7 for package: gcc-4.8.5-36.el7.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-36.el7.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-36.el7.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-36.el7.x86_64
---> Package gcc-c++.x86_64 0:4.8.5-36.el7 will be installed
--> Processing Dependency: libstdc++-devel = 4.8.5-36.el7 for package: gcc-c++-4.8.5-36.el7.x86_64
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-36.el7 will be installed
---> Package glibc-devel.x86_64 0:2.17-260.el7 will be installed
--> Processing Dependency: glibc-headers = 2.17-260.el7 for package: glibc-devel-2.17-260.el7.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-260.el7.x86_64
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package libstdc++-devel.x86_64 0:4.8.5-36.el7 will be installed
---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
--> Running transaction check
---> Package glibc-headers.x86_64 0:2.17-260.el7 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-260.el7.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-260.el7.x86_64
--> Running transaction check
---> Package kernel-headers.x86_64 0:3.10.0-957.el7 will be installed
--> Finished Depen
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值