Install GoAccess on Ubuntu 20.04?

Windows Articles

How to access System in Windows 10

Perhaps the title of this post is misleading. In previous versions of Windows, it was enough to enter the Control Panel and from there,...

Microsoft reduces the fragmentation of Windows 10

Windows 10 20H2 has been released as a minor operating system update. As a result, it has managed to reduce platform errors. In addition,...

How to install Nginx and PHP on FreeBSD?

Hello, friends. FreeBSD is a secure system even more than Linux, that's why it's used as the main server. And a server has to...

How to enable local port forwarding using Ubuntu 20.04 and ssh

SSH, a very popular tool found almost with every IT guy. Commonly, when we talk about the insecure network for data, ssh is the...

How to use CHKDSK in Windows 10

Hello! It is very important to ensure the integrity of the hard disk in the computer. Since it is an essential element for the...
angeloma
angeloma
Senior Writer and partner

Hello, friends. In this post, you will learn how to install GoAccess on Ubuntu 20.04. This way you will be able to monitor your web server without problems.

What is it?

According to the project’s website,

GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.

Also, “It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly”.

Some features are:

  • Fast, real-time, millisecond/second updates, written in C
  • Only ncurses as a dependency
  • Nearly all web log formats (Apache, Nginx, Amazon S3, Elastic Load Balancing, CloudFront, etc)
  • Simply set the log format and run it against your log
  • Beautiful terminal and bootstrap dashboards (Tailor GoAccess to suit your own color taste/schemes)
  • and of course, Valgrind tested.

Installing GoAccess on Ubuntu 20.04

GoAccess is available in the official Ubuntu repositories, so the installation is quite simple but it is convenient to have the latest version available. So, you have to add the GoAccess repository.

To do this, open a terminal and execute the following commands:

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 --keyring /etc/apt/trusted.gpg.d/goaccess.gpg add -

Now refresh the APT cache:

sudo apt update

And performs the installation running:

sudo apt install goaccess
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
linux-headers-5.4.0-26 linux-headers-5.4.0-26-generic linux-image-5.4.0-26-generic linux-modules-5.4.0-26-generic linux-modules-extra-5.4.0-26-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libncursesw5 libtinfo5
The following NEW packages will be installed:
goaccess libncursesw5 libtinfo5
0 upgraded, 3 newly installed, 0 to remove and 53 not upgraded.
Need to get 535 kB of archives.
After this operation, 1889 kB of additional disk space will be used.
Do you want to continue? [Y/n]

If you want, you ca check the installed version:

GoAccess - 1.4.
For more details visit: http://goaccess.io
Copyright (C) 2009-2020 by Gerardo Orellana

And so you can get GoAccess, now let’s use it a little.

Using GoAccess on Ubuntu 20.04

The first thing you can do is check the help that the terminal gives us, for that you can run:

goaccess --help

On the other hand, the most basic way to use goaccess is simply by specifying a log file.

goaccess /var/log/apache2/access.log

Or you can select the log of your Virtualhost.

There you will be shown a screen in the terminal where you can choose the log output format.

1.- Using GoAccess on Ubuntu 20.04
1.- Using GoAccess on Ubuntu 20.04

In my case, I have chosen the third option (CLF).

And immediately it will start the analysis.

2.- Log view on GoAccess
2.- Log view on GoAccess

Note: I am working with a home test server. Therefore, there is not so much activity in the log.

But you can also specify a log format to make it work with, for example, squid. Although we recommend that you read the official documentation

A very interesting option is to display it directly on your web browser. I think this is the best possible option.

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

And this will generate a file that you can open from the browser. Remember to modify the name of the output file.

3.- GoAccess html log view
3.- GoAccess html log view

And this is the basic use of GoAccess as we see is a basic but very useful tool.

Conclusion

Having a program that can analyze logs graphically and interactively is an advantage for all of us who work on Linux. That’s why today we wanted to show you GoAccess.

So, share this post and join our Telegram channel and our Facebook page. Also, buy us a coffee 😉

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to access System in Windows 10

Perhaps the title of this post is misleading. In previous versions of Windows, it was enough to enter the Control Panel and from there,...

Microsoft reduces the fragmentation of Windows 10

Windows 10 20H2 has been released as a minor operating system update. As a result, it has managed to reduce platform errors. In addition,...

How to install Nginx and PHP on FreeBSD?

Hello, friends. FreeBSD is a secure system even more than Linux, that's why it's used as the main server. And a server has to...

How to enable local port forwarding using Ubuntu 20.04 and ssh

SSH, a very popular tool found almost with every IT guy. Commonly, when we talk about the insecure network for data, ssh is the...

How to use CHKDSK in Windows 10

Hello! It is very important to ensure the integrity of the hard disk in the computer. Since it is an essential element for the...
x