Atlantic.Net Blog

How to Install GoAccess Web Log Analyzer on Rocky Linux 8

Hitesh Jethva
by Atlantic.Net (345 posts) under Dedicated Server Hosting, Tutorials
0 Comments

GoAccess is a free, open-source, lightweight log analyzer written in C language. It can read and analyze log files of Apache, Nginx, CloudFront, Caddy, and more. It uses the ncurses library for its CLI interface. It is an interactive and real-time web server log analyzer that helps you to analyze and view web server logs quickly.

Features

  • Display general Statistics, and bandwidth
  • Support for HTTP/2 and IPv6
  • Display metrics per virtual host
  • Support for large datasets + data persistence
  • Display top visitors, referring sites, and URLs

In this post, we will show you how to install GoAccess Web Log Analyzer on Rocky Linux 8.

Prerequisites

  • A server running Rocky Linux 8 on the Atlantic.Net Cloud Platform
  • A root password configured on your server

Step 1 – Create Atlantic.Net Cloud Server

First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing Rocky Linux 8 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged in to your server, run the following command to update your base system with the latest available packages.

dnf update -y

Step 2 – Install Required Packages

First, you will need to install the required tools on your server. You can install all of them with the following command:

dnf install httpd ncurses-devel libmaxminddb-devel openssl-devel 
dnf groupinstall 'Development Tools'

Once all the packages are installed, start and enable the Apache service using the following command:

systemctl start httpd
systemctl enable httpd

Step 3 – Install GoAccess on Rocky Linux 8

By default, GoAccess is not included in the Rocky Linux default repo, so you will need to compile it from the source.

First, download the latest version of GoAccess with the following command:

wget https://tar.goaccess.io/goaccess-1.5.4.tar.gz

Once the download is completed, extract the downloaded file with the following command:

tar -xvzf goaccess-1.5.4.tar.gz

Next, change the directory to the extracted directory and compile it using the following command:

cd goaccess-1.5.4
autoreconf -fi
./configure --enable-utf8 --with-openssl
make
make install

Once the installation is complete, verify the GoAccess version with the following command:

goaccess --version

You will get the following output:

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

Build configure arguments:
  --enable-utf8
  --with-openssl

Step 4 – Configure GoAccess

The GoAccess main configuration file is located at /usr/local/etc/goaccess/goaccess.conf. Most of the options are commented out, so you will need to edit the file and enable the required options.

nano /usr/local/etc/goaccess/goaccess.conf

Change the following lines to enable and disable some recommended options:

time-format %H:%M:%S
date-format %d/%b/%Y
#ignore-panel REFERRERS
log-format COMBINED

Save and close the file when you are finished.

Step 5 – Run GoAccess

First, we will run the GoAccess by specifying the Apache log file. The Apache log files keep a record of all incoming HTTP traffic. You can analyze and monitor the Apache logs using the following command:

goaccess /var/log/httpd/access_log

You should see the following interface:
GoAccess interface
In the above interface, you should see the Apache logs including the following:

  • Unique visitors per day
  • Requested Files (URLs)
  • Static Requests
  • Not Found URLs (404s)
  • Visitor Hostnames and IPs
  • Operating Systems
  • Browsers
  • Time Distribution
  • Virtual Hosts

Step 6 – Generate HTML Reports

GoAccess also allows you to generate HTML reports which you can access online through the web browser.

Run the following command to generate an HTML report:

goaccess /var/log/httpd/access_log -o /var/www/html/stats.html

Now, open your web browser and access the generated reports using the URL http://your-server-ip/stats.html. You should see the following dashboard:
GoAccess report
Now, go back to your terminal and press the CTRL+C to close the GoAccess.

GoAccess also allows you to generate a real-time HTML report. Run the following command to generate a real-time report and run GoAccess in the background:

goaccess /var/log/nginx/access.log -o /var/www/html/livereport.html --real-time-html --daemonize

You can now access the GoAccess real-time report using the URL http://your-server-ip/livereport.html. You should see the following screen:
GoAccess real-time report
Now, go back to your terminal and kill the GoAccess process using the following command:

kill -9 `pidof goaccess`

Conclusion

In this guide, we explained how to install and configure GoAccess Log Analyzer on Rocky Linux 8. We also explained how to monitor Apache web server logs in real-time through the web browser. Try it on dedicated hosting from Atlantic.Net!

Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

How to Install Python 3.10 on Rocky Linux 8
How to Install TaskBoard on Rocky Linux 8
How to Set Up Pritunl VPN Server on Rocky Linux 8
How to Install Teampass Password Manager on Rocky Linux 8
How to Install and Configure RabbitMQ Server on Rocky Linux 8

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources