hosting image
How to Installing GoAccess on a Centos 7

How to Installing GoAccess on a Centos 7?

Installing GoAccess on a Centos 7 server

GoAccess offers real-time analytics for web server access logs and is a potent open-source log analyzer and interactive web log viewer. It is a useful tool for server administrators, developers, and digital marketers since it provides a straightforward and user-friendly interface for tracking and analyzing website traffic. In this post, we’ll walk you through installing GoAccess on a CentOS 7 server so you can learn crucial information about the traffic to your website.

Introduction

Understanding visitor behaviour, spotting patterns, and improving web server performance all depend on website analytics. GoAccess streamlines this procedure by offering a real-time examination of the access logs on your server. On your CentOS 7 server, GoAccess may be installed so that you can create thorough reports, display data, and learn useful information about the traffic to your website.

Understanding GoAccess

GoAccess makes use of the log files produced by web servers like Nginx and Apache. It analyzes these logs and produces dynamic HTML reports, enabling you to keep track of important indicators like the number of unique visitors, the most popular pages, referring websites, geographic information, and more. With GoAccess, you can rapidly see traffic peaks, discover possible security risks, and take well-informed choices to enhance the functionality of your website.

Benefits of Installing GoAccess on a Centos 7 Server

Adding GoAccess to your CentOS 7 server has the following advantages:

  • Real-time Monitoring: GoAccess gives you real-time information on the traffic to your website, enabling you to respond quickly to any problems or abnormalities.
  • Reports that are in-depth: The tool creates reports that are in-depth and provide helpful insights into visitor behaviour, popular URLs, bandwidth use, and other important data.
  • GoAccess is a user-friendly online interface that is dynamic and straightforward, making it simple to investigate the produced reports.
  • Options for Customization: You may alter the reports to meet your needs, allowing you to concentrate on certain data points or eliminate superfluous data.
  • GoAccess is meant to be resource-friendly, having little effect on server performance. It is lightweight and efficient.
See also  How to Change linux VPS Password?

Let’s now go through the installation of GoAccess on a CentOS 7 server step by step.

Prerequisites for Installing GoAccess

Before proceeding with the installation, ensure that you have the following prerequisites:

  1. A CentOS 7 server with root access or a user with sudo privileges.
  2. A web server (Apache or Nginx) installed and running on your CentOS 7 server.
  3. Basic knowledge of the command line interface.

Step 1: Updating the System

On your CentOS 7 server, updating the system packages comes first. Run the following command on your server by opening a terminal or connecting through SSH:

sudo yum update

 Installing GoAccess on a Centos 7

This command will upgrade any out-of-date packages on your system and update the package repository.

Step 2: Installing Dependencies

For proper operation, GoAccess depends on a number of other components. Use the following command to install these dependencies:

sudo yum install ncurses-devel GeoIP-devel libmaxminddb-devel

The command will fetch and install the necessary packages.

 Installing GoAccess on a Centos 7

Step 3: Downloading GoAccess

Downloading the GoAccess source code is the next step. Go to the “Downloads” section on the official GoAccess website (https://goaccess.io/). Copy the URL for the most recent stable version.

Use the following command to download GoAccess once you are back on your server:

wget [GoAccess Download URL]

Replace [GoAccess Download URL] with the link you copied.

 Installing GoAccess on a Centos 7

Step 4: Compiling and Installing GoAccess

Once you’ve downloaded the source code, you must install and build GoAccess. Execute these commands:

tar xzvf goaccess-[version].tar.gz
cd goaccess-[version]/
./configure --enable-utf8
make
sudo make install

[version] should be changed to the precise version number you downloaded.

It can take a little while for the compilation and installation procedure to be finished.

Installing GoAccess on a Centos 7

Installing GoAccess on a Centos 7

Step 5: Configuring GoAccess

Once GoAccess is installed, you need to configure it to analyze your server’s access logs. Create a configuration file using the following command:

sudo nano /etc/goaccess.conf

Installing GoAccess on a Centos 7

You may set the location to the log file, the date format, the output format, and more in the configuration file. Change the options to suit your needs, then save the file.

See also  What Happens When RAM Is Full in Linux?

Step 6: Running GoAccess

With the configuration file in place, you can now run GoAccess and start analyzing your logs. Use the following command:

sudo goaccess -c /etc/goaccess.conf -a -o /var/www/html/report.html

This command runs GoAccess with the specified configuration file, generates the report, and saves it as report.html in the /var/www/html directory.

You can access the report by visiting http://<your-server-IP>/report.html in a web browser.

Using GoAccess with Apache

To use GoAccess with Apache, you need to enable the Apache log format. Open the Apache configuration file using a text editor:

sudo nano /etc/httpd/conf/httpd.conf

 

Installing GoAccess on a Centos 7

Add the following at the end of the line that begins with LogFormat:

"%h %^[%d:%t %^] \"%r\" %s %b \"%R\" \"%u\""

Installing GoAccess on a Centos 7

For the modifications to take effect, save the file and restart Apache:

sudo systemctl restart httpd

Now, GoAccess ought to be able to decipher and evaluate Apache logs.

Using GoAccess with Nginx

You must change Nginx’s settings if you’re using it as your web server if you want to log data correctly. Using a text editor, open the Nginx configuration file:

sudo nano /etc/nginx/nginx.conf

Installing GoAccess on a Centos 7

Add the following line after the http block:

log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent"';

Installing GoAccess on a Centos 7

For the modifications to take effect, save the file and restart Nginx:

sudo systemctl restart nginx

Now, GoAccess ought to be able to decipher and evaluate Nginx logs.

Customizing GoAccess Reports

GoAccess provides a number of customization options so you may cater the reports to your own requirements. To concentrate on pertinent data, you may change the report’s design, activate or disable certain metrics, and use filters.

For comprehensive directions on modifying repor, see the official GoAccess documentation.

See also  How To Find A File In Linux

Integrating GoAccess with Other Tools

GoAccess provides integration options with popular analytics and monitoring tools. You can export data to external services such as Elasticsearch, AWS S3, or MongoDB, enabling you to consolidate your analytics ecosystem and gain deeper insights into your website’s performance.

Refer to the official GoAccess documentation for instructions on integrating with other tools.

Conclusion

You can unleash the potential of real-time web log analytics by installing GoAccess on your CentOS 7 server. You may make data-driven choices to boost website speed, increase security, and enhance user experience by watching and examining your server’s access logs.

For server administrators, developers, and digital marketers, GoAccess is a useful tool because to its user-friendly interface and many customization possibilities. With GoAccess, you can observe traffic trends, get useful insights, and maintain your website’s performance edge.

FAQs

Absolutely. GoAccess supports analyzing logs from multiple web servers simultaneously. You can consolidate logs from Apache, Nginx, and other servers into a single GoAccess report.

Yes, GoAccess is designed to handle large log files efficiently. Its performance is optimized to process and analyze logs of considerable size without compromising speed or resource usage.

Yes, GoAccess provides real-time analytics by continuously monitoring and updating the reports as new log entries are recorded. You can observe live traffic patterns and make immediate observations.

GoAccess is suitable for websites of all sizes. Whether you have a small personal blog or a large e-commerce platform, GoAccess can provide valuable insights into your website's traffic and performance.

 

5/5 - (1 vote)

3 Comments

  • Wow! After all I got a webpage from where I know how to truly obtain helpful facts concerning my study and knowledge.

  • Hi! I could have sworn I’ve visited this web site before but after looking at many of the
    articles I realized it’s new to me. Regardless, I’m definitely happy I stumbled upon it and
    I’ll be bookmarking it and checking back
    frequently!

  • Bel article, je l’ai partagé avec mes amis.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Setup Your Server