一.下载
下载地址:http://goaccess.io/
二.安装
<code>yum <span>-y</span> install glib2 glib2<span>-devel</span> ncurses ncurses<span>-devel</span> GeoIP<span>*</span></code>
<code><span>.</span>/configure –enable<span>-geoip</span> –enable<span>-utf8</span>make <span>&&</span> make install </code>
三.使用
1.命令行直接查看
<code>goaccess <span>-f</span> access<span>.</span><span>log</span><span>-c</span><span>-a</span></code>
2.输出到html中
配置~/.goaccessrc文件
<code>color_scheme <span>0</span> date_format <span>%d</span>/<span>%b</span>/<span>%Y</span> log_format <span>%h</span><span>%^</span>[<span>%d</span>:<span>%^</span>] “<span>%r</span>” <span>%s</span><span>%b</span> “<span>%R</span>” “<span>%u</span>” <span>%T</span></code>
生成命令
<code>goaccess <span>-f</span> /web/nginx/logs/access<span>.</span><span>log</span><span>-a</span><span>></span> report<span>.</span>html</code>
参考:
http://my.oschina.net/mrco/blog/181737
以上就介绍了Nginx系列(十六)nginx日志分析goaccess,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。