goaccess 安装

今天尝试搭建goaccess,用于分析access.log文件,但安装并不顺利,小记一下自己遇到的问题及解决方法

系统环境:CentOS release 6.9

一.参照官网教程进行搭建

$ 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

运行configure未顺利通过,提示“Missing development files for the GeoIP library”错误,如下

二、解决流程

1.yum安装GeoIp,失败

2.yum 安装 GeoIP-devel也提示未找到

3.yum list | grep GeoIp也未搜寻到相关包,至此怀疑是系统原有yum源可能未收录相关包

4.尝试更改yum源为阿里云的yum源

备份原来的yum源

cd /etc/yum.repos.d/
mkdir bak
mv * bak

下载阿里云yum源

wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

重新构建yum

yum clean all
yum makecache

5.再次尝试安装GeoIp-devel,GeoIp,还是未找到相关包

6.网上搜索,参考了这篇文章,略作修改

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
yum install glib2 glib2-devel GeoIP-devel  ncurses-devel zlib zlib-devel
yum -y install GeoIP-update

7.再次源码安装goaccess,成功

./configure --enable-utf8 --enable-geoip=legacy
make 
make install

简单测试一下

goaccess -d -f access.log

 

posted on 2018-12-19 14:46  我以前不是胖子  阅读(1783)  评论(0编辑  收藏  举报

导航