How to Install and Use Lnav Log Viewer on Ubuntu 16.04 LTS

GoAccess is a free of charge, available supply and real-time internet host log analyzer device you can use to evaluate and see internet host logs. GoAccess is founded on demand line as well as creates reports that are HTML can be viewed through a web browser. It has several features including, General Statistics, bandwidth, Different Color Schemes, Top Visitors, Referring Sites & URLs, Operating Systems, Browsers, Metrics per Virtual Host and much more.

In this tutorial, we will learn how to install GoAccess in Ubuntu 16.04 server.

Requirements

  • A server running Ubuntu 16.04.
  • A non-root user with sudo privileges.

Getting Started

Before starting, it is recommended to update your system with the latest version. You can do this by running the command that is following***)

sudo apt-get upgrade -y
sudo apt-get update -y

Once the body is updated, restart the machine to use all updates.

Install needed Dependencies

GoAccess is written into the C program writing language, and that means you will have to install some dependencies needed by GoAccess. It is possible to install these with the next demand:

sudo apt-get -y install libncursesw5-dev gcc make libgeoip-dev libtokyocabinet-dev build-essential -y

Once all dependencies are set up, you are able to check out another step.

Install Apache Web Server

GoAccess is a web host log analyzer device, and that means you will have to install Apache towards system. It is possible to do the installation with all the command that is following***)

sudo apt-get install apache2 -y

Once the Apache is installed, start the apache service and enable it to start on boot time:

sudo systemctl start apache2
sudo systemctl enable apache2

Install GoAccess

You can install GoAccess using either from GoAccess source or from Ubuntu repository.

Install GoAccess from Source

First, you will need to download the latest version of the GoAccess from their official website with the following command:

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

Next, extract the downloaded file with the following command:

tar -xzvf goaccess-1.2.tar.gz

Next, change the directory to the goaccess-1.2 and compile GoAccess by running the command that is following***)

cd goaccess-1.2
sudo ./configure –enable-utf8 –enable-geoip=legacy
sudo make
sudo make***) that is instal

Install GoAccess from Repository

First, you will need to add the GoAccess repository to the APT. You can do this with the command that is following***)

echo “deb http://deb.goaccess.io/ $(lsb_release -cs) main” | sudo tee -a /etc/apt/sources.list.d/goaccess.list
wget -O – https://deb.goaccess.io/gnugpg.key | sudo apt-key add –

Next, update the repository using the command that is following***)

sudo apt-get update -y

Finally, install GoAccess by running the following command:

sudo apt-get install goaccess -y

Use GoAccess

GoAccess is now installed, it’s time to test it with Apache web server.

First, open access your Apache web server using the URL http://your-server-ip. After accessing the Web server, Apache will add some log entries in the default access_log file.

Now, you can analyze the Apache web server log from a terminal using the command that is following***)

sudo goaccess /var/log/apache2/access.log –log-format=COMBINED

You should understand Apache internet host log report into the after image:

Apache GoAccess Log Analyzer

You also can create an HTML report with all the after demand:

sudo goaccess /var/log/apache2/access.log –log-format=COMBINED -a -o /var/www/html/report.html

Once the report is created, start your on line web browser and kind the Address http://your-server-ip/report.html. You ought to understand report created by GoAccess into the image that is following***)

GoAccess HTML Report

Static report

Visitor Hostname and IP report

Browser report

Referring sites report

Congratulations! you have successfully installed GoAccess in Ubuntu 16.04 server. You can now easily analyze Apache web server log from a web CLI.( and interface***)

LEAVE A REPLY

Please enter your comment!
Please enter your name here