nginx日志分析工具goaccess

技术文档 - PHP文档 作者: xcheng1986 发布于:2014-06-16 阅读(2544) (暂无评论)  


安装GoAccess 如果你是centos,使用yum:
yum install goaccess
如果你的yum找不到goaccess,就先安装epel
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
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

方式二:
$ wget http://tar.goaccess.io/goaccess-0.8.1.tar.gz
$ tar -xzvf goaccess-0.8.1.tar.gz
$ cd goaccess-0.8.1/
$ ./configure --enable-geoip --enable-utf8
$ make
$ make install

参数选项Configure Options
Multiple options can be used to configure GoAccess. For a complete up- to-date list of configure options, run ./configure --help
--enable-debug
Compile with debugging symbols and turn off compiler optimizations.
--enable-utf8
Compile with wide character support. Ncursesw is required.
--enable-geoip
Compile with GeoLocation support. MaxMind's GeoIP is required.
--enable-tcb=
Compile with Tokyo Cabinet storage support. memhash will utilize Tokyo Cabinet's on-memory hash database. btree will utilize Tokyo Cabinet's on-disk B+ Tree database.
--disable-zlib
Disable zlib compression on B+ Tree database.
--disable-bzip
Disable bzip2 compression on B+ Tree database.


GoAccess 使用方法
进入 Nginx 日志所在目录
命令行直接查看
goaccess -f access.log -c -a

使用GoAccess生成文件
goaccess -d -f web.log -a -p /home/yejianfeng/.goaccessrc > test.html