今天嘗試搭建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