GoAccess is an open-source weblog analyzer program for Linux and UNIX systems. GoAccess can be used to analyze real-time logs in either the terminal or via a web browser. This popular software is written in C language and is used to analyze log files.

GoAccess runs in the terminal and provides a dashboard with separate panels to organize the statistics. Another feature of GoAccess is its ability to easily create log files to understand formats such as HTML, JSON, and CSV.

This tutorial will show you how to install GoAccess on CentOS 7.

Note: To execute commands, you need to have root access. If not, you can start commands with “sudo".

Prerequisites

Install GoAccess on CentOS 7

Step 1: Install the required repository

In this tutorial, we want to install GoAccess from its source code. This kind of installation needs some dependencies that are not provided by the official CentOS repository.

Firstly, you should install the Epel repository using the below command:

yum install epel-release

After installing the Epel repository, update your repository list using the following command:

yum repolist

Step 2: Install dependencies

Now we will install the dependencies needed to install the GoAccess program from its source code.

yum install ncurses-devel gcc

yum install geoip-devel tokyocabinet-devel

Don’t forget to press y to continue with the installation when prompted.

Step 3: Install GoAccess

GoAccess's official website is https://goaccess.io/, and you can download the desired version of GoAccess from its site. In this tutorial, we will be installing version 1.2. Use the below command to download GoAccess:

wget http://tar.goaccess.io/goaccess-1.2.tar.gz

Using the tar command below, extract the “tar” file:

tar xvzf goaccess-1.2.tar.gz

Execute the following commands one after the other to configure and install GoAccess:

cd goaccess-1.2

./configure --enable-utf8 --enable-geoip=legacy

make && make install

Now we will need to link the GoAccees binary file. Using the below command, you will be able to create a Symlink of GoAccess binary file in your executable path:

ln -s /usr/local/bin/goaccess /usr/bin/goaccess

Step 4: Using GoAccess

We have successfully configured and installed GoAccess on our CentOS 7 server. To see your log file using GoAccess, you can use the below command:

goaccess /var/log/yum.log

There’s a help page that you can access to learn more in-depth about GoAccess. Execute the following command to know what more GoAccess has to offer:

goaccess --help

Conclusions

You have successfully installed and configured GoAccess on CentOS 7 VPS. If you are facing any problems with the installation, feel free to drop us a comment here. We will be happy to help you out and solve your problem.

People also read: