Installing Goaccess, a Visual Website Log Analysis Tool

5,697 0

Software Introduction

Goaccess is an open-source real-time website log analysis tool. Goaccess works by reading and parsing the access log files of servers such as Apache/Nginx/Lighttpd, displaying statistical information in an intuitive way, including an overview of visits, dynamic page requests, static page requests, visitor rankings, visitors' operating systems, visitors' browsers, referring domains, 404 errors, search crawlers, search keywords, and more.

Goaccess not only uses different colors to distinguish information in the terminal, but can also output detailed charts for users' reference. It supports the analysis of server logs from Apache, Nginx, Amazon S3, Elastic Load Balancing, CloudFront, and others. It is not limited to LNMP; any of the log formats listed above can be used.

Installing Goaccess

Install the dependency packages, and be sure to distinguish between your systems.

Ubuntu/Debian:

Plain Text
apt-get install libncursesw5-dev libgeoip-dev libtokyocabinet-dev

Fedora/RHEL/CentOS:

Plain Text
yum install ncurses-devel geoip-devel tokyocabinet-devel

Install Goaccess by executing the commands one by one in order.

Plain Text
wget http://tar.goaccess.io/goaccess-1.2.tar.gztar xzvf goaccess-1.2.tar.gzcd goaccess-1.2/./configure --enable-geoip --enable-utf8make && make install

How to Use

Generate a chart webpage.

Plain Text
goaccess -f /home/www.ikxin.com.log --log-format=COMBINED -a > /www/wp-xinye/web.html

/home/www.ikxin.com.log is the path to your log file.

/www/wp-xinye/web.html is the path to the page you want to generate.

This generates a highly intuitive webpage chart that can be opened directly in a browser for viewing.

You can also use it with crontab to run it periodically and automatically generate charts.

Execute: crontab -e

Add a line:

Plain Text
50 23 * * * goaccess -f /home/www.ikxin.com.log --log-format=COMBINED -a > /www/wp-xinye/web.html

This means that a log webpage chart for the corresponding domain will be generated every day at 23:50. Below is one of my own charts.

Comments

(0)

No comments yet. Start the conversation.

Leave a comment