在 CentOS 6.5 上安装编译 GoAccess 时需要的工具和库:
# yum groupinstall 'Development Tools'
# yum install glib2 glib2-devel ncurses-devel
在 Ubuntu 12.04 上安装编译 GoAccess 时需要的工具和库:
$ sudo apt-get install build-essential
$ sudo apt-get install libglib2.0-dev libncursesw5-dev
下载 GoAccess 的源代码、编译和安装:
$ wget http://downloads.sourceforge.net/project/goaccess/0.7.1/goaccess-0.7.1.tar.gz
$ tar -xzvf goaccess-0.7.1.tar.gz
$ cd goaccess-0.7.1/
$ ./configure --enable-utf8
$ make
$ sudo make install
运行 GoAccess,选择 NCSA Combined Log Format:
$ /usr/local/bin/goaccess -f /var/log/apache2/access.log
+--------------------------------------------------+
| Log Format Configuration |
| [SPACE] to toggle - [ENTER] to proceed |
| |
| [ ] Common Log Format (CLF) |
| [ ] Common Log Format (CLF) with Virtual Host |
| [x] NCSA Combined Log Format |
| [ ] NCSA Combined Log Format with Virtual Host |
| [ ] W3C |
| [ ] CloudFront (Download Distribution) |
| |
| Log Format - [c] to add/edit format |
| %h %^[%d:%^] "%r" %s %b "%R" "%u" |
| |
| Date Format - [d] to add/edit format |
| %d/%b/%Y |
+--------------------------------------------------+
界面如下: