How to Install GoAccess and Nginx as Web Analyzer on Ubuntu

How to Install GoAccess and Nginx as Web Analyzer on Ubuntu
How to Install GoAccess and Nginx as Web Analyzer on Ubuntu

How to Install GoAccess and Nginx as Web Analyzer on Ubuntu - Hi all. On this occasion, I will share how to install GoAccess on Linux Ubuntu combined with Nignx.

Do you know what GoAccess is? GoAccess is an open-source real-time web log analyzer and interactive viewer that runs in a terminal or through your browser.

It provides fast and valuable HTTP statistics for system administrators who require a visual server report on the fly.

Preparation

I created a directory that will be used as root on the vhost that I will create, not only that, I will use the directory for the converted files with goaccess.

$ sudo mkdir -p /apps/monitoring/goaccess

Installing

Setting up a local yum repository allows for efficient and faster package management, ensuring that software installations and updates on the system are sourced from a nearby repository, and reducing dependency on external servers. 

Just install nginx and goaccess like the command below. 

$ sudo apt-get install nginx
$ sudo apt-get install goaccess

Configure

Nginx

Here I create a vhost with the direction of the path that I have made above.

$ sudo vim /etc/nginx/sites-enabled/goaccess.conf
server {

        listen 1234;

        server_name goaccess;
        root /apps/monitoring/goaccess;
        index index.html index.htm index.nginx-debian.html;
      
        location / {
                try_files $uri $uri/ =404;
        }
}
$ sudo chown www-data.www-data /apps/ -R 

Change Owner and Group to www-data
Change Owner and Group to www-data

$ sudo nginx -t
$ sudo systemctl restart nginx
$ sudo systemctl enable nginx
$ sudo systemctl status nginx 

GoAccess

Next, we will parse an access log. Here I already have an access log for example. And parsed with GoAccess to html format which will later be accessed with nginx.

$ sudo goaccess kitska_access.log --log-format=COMBINED -a -o /apps/monitoring/goaccess/report.html

Trying

In order to view the generated HTML report, simply navigate to report.html using your web browser.

Report.html GoAccess
Report.html GoAccess

Closing statement

In conclusion, installing GoAccess and Nginx as a web analyzer on Ubuntu provides system administrators with a powerful tool for real-time web log analysis and visualization. 

By following the steps outlined above, you can efficiently set up and configure GoAccess to generate insightful HTTP statistics, complemented by Nginx's robust server capabilities. 

Whether you're managing a small-scale website or overseeing a complex network infrastructure, integrating GoAccess and Nginx offers valuable insights into server performance and visitor behavior.

Maybe that's all I can share with you guys, hopefully this article will be useful.

Thank You 

Bangkit Ade Saputra
Bangkit Ade Saputra At the end of the day, my job involves people. we're complicated, we're always changing, we have millions of things going on in our lives, and changing jobs is always a big decision.

Post a Comment for "How to Install GoAccess and Nginx as Web Analyzer on Ubuntu"