Install and configure Matomo analysis platform on CentOS 8

To
You can download this article in PDF format via the link below to support us.

Download the guide in PDF format

turn off
To

To
To

A strong online presence is the goal that most organizations, e-commerce sites, blogs, politicians, and every faction that depends on it must achieve to increase their customer coverage. Having such an excellent online image is a beautiful thing, but how do you accurately measure its success, failure, opportunity and insight into areas for improvement? Feedback can be a strategy, but as you know, due to its unstable nature, feedback cannot be completely dependent on it. On the other side of the trend, this matter can be used to generate reliable insights.

Data has completely changed how to make decisions in all aspects of life. Whether in education, business, health or politics. We can borrow from it to better understand the progress of our blogs, e-commerce sites, websites and other web-driven online businesses. It’s rare to find a website with a hosting site, so the rise of Web Analytics is not common. In short, Web Analytics is the process of collecting, processing and analyzing website data. We thank Matomo for proposing a leading open alternative to Google Analytics, which gives you complete control over the data. Let us now delve into this Matomo analysis platform.

Matomo is a full-featured PHP MySQL software program that you can download and install on your own web server, and allows you to easily collect data from websites, applications and IoT. Subsequently, it gives you the opportunity to visualize this data and extract insights. Privacy is built-in, and with just a few clicks, you can now install Matomo directly in WordPress as a plugin.

“I will prepare, and one day my opportunity will come.”-Abraham Lincoln

Unique features of Matomo

Matomo has the following functions:

  • Full control of your web analytics data: Since Matomo is installed on the server, the data is stored in your own database, and you can use the powerful Matomo Analytics API to get all statistics.
  • Matomo is a free software that can be easily configured to respect the privacy of visitors.
  • Easy-to-use modern user interface.
  • Matomo features are built into the plug-in: you can add new features or delete unnecessary features.
  • A vibrant international open community with 200,000 active users.
  • Advanced web analysis functions, such as e-commerce tracking, goal tracking, activity tracking, custom variables, email reports, custom segmentation editor, geographic location, real-time access and maps, etc.!

System Requirements

In order to install and use Matomo analysis platform on your CentOS 8 server, we must meet the following requirements.

  • PHP 5.5.9 or higher
  • Network Server
  • MySQL 5.5 or higher, or MariaDB
  • PHP extension pdo and pdo_mysql or MySQLi extension

Step 1: Server preparation

Jump to the terminal of the new CentOS 8 server, update it and install the basic tools that will be used during the installation process.

sudo dnf update
sudo dnf -y install git unzip vim nginx

Disable SELinux

If you can handle SELinux easily, this is optional. To set it to permissive mode, run the following command in the server.

sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config

Step 2: Install PHP

By installing it in the server, let us meet the above PHP requirements. Please follow how to install PHP 7.4 on CentOS 8. The RHEL 8 guide can quickly get everything up and running.

After installing PHP 7.4 correctly, add the following modules as shown below

sudo yum install -y php-cli php-pdo php-common php-mysql php-curl php-json php-zip php-gd php-xml php-mbstring

Edit the php-fpm file /etc/php-fpm.d/www.conf and set the user and group to nginx. Usually, they are set to apache by default.

$ sudo vim /etc/php-fpm.d/www.conf

user = nginx
group = nginx

Open your php-fpm ini file and add/edit the details shown below. They include time zone and memory limit settings. Add your date.timezone and change the memory_limit to 512MB.

$ sudo vim /etc/php.ini

memory_limit = 512M

[Date]

date.timezone = Africa/Nairobi

After making these changes, restart php-fpm

sudo systemctl restart php-fpm

Step 3: Install and set up the database

Matomo needs a database, as mentioned before. Therefore, we will set up and use MariaDB. Fortunately, we already have a detailed guide to install MariaDB 10.5 on CentOS 8. CentOS 7

After installing the database, create the database and users that Matomo will use. Complete this task as shown in the figure below. You can use different names to name the database and users at will, and make sure to use secure passwords.

$ mysql -u root -p

MariaDB [(none)]> CREATE DATABASE matomodb;
MariaDB [(none)]> GRANT ALL ON matomodb.* TO 'matomoadmin' IDENTIFIED BY 'SafePassword';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> quit

Step 4: Install Matomo Analytics

We will create a directory and place the Matomo files in it. This will also help us set the root directory where the web server will look for service files.

sudo mkdir /var/www/html-matomo && cd /var/www/html-matomo

Extract the Matomo file and unzip it.

sudo wget https://builds.matomo.org/matomo.zip
sudo unzip matomo.zip

The above command will unzip the file and place Matomo Folders in the directory. The root directory we want becomes /var/www/html-matomo/matomo.

Step 5: Configure the web server

Open the Nginx configuration file and edit the server block as shown below. Make sure to place the correct server_name and root directory according to your environment.

$ sudo vim /etc/nginx/nginx.conf

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /var/www/html-matomo/matomo;
        server_name example.com;

        index index.php index.html;
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
                try_files $uri /index.php$is_args$args;
        }
        location ~ .php$ {
           fastcgi_pass unix:/run/php-fpm/www.sock;
           fastcgi_index index.php;
           fastcgi_read_timeout 240;
           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           include fastcgi_params;
               fastcgi_split_path_info ^(.+.php)(/.+)$;
        }
    }

Modify the permissions on the root directory and restart the web server

sudo chown -R nginx:nginx /var/www/html-matomo
sudo chmod -R 755 /var/www/html-matomo
sudo systemctl restart nginx php-fpm

Modify the firewall rules to allow port 80 or 443 as needed:

sudo firewall-cmd --permanent --add-service={http,https}/tcp
sudo firewall-cmd --reload

Step 6: Complete Matomo installation through the web interface

After everything goes well so far, we should be in the final stages of installing Matomo Analytics. Open in this step http: //[ip-address-or-domain-name] Launch the Matomo installation panel on your browser. The first page will be a welcome page as shown below. Click “next

System check

On the next page, Matomo will check your server against the conditions required for a successful installation. All scales on this page should be green. Scroll down and click “next”

Install and configure Matomo analysis platform on CentOS 8

Database settings

On this page, enter the database details we created in it third step then click”next“. Give it time to create the table, you should successfully create the table! Information.

Install and configure Matomo analysis platform on CentOS 8

Create a table

On the next page. Just click “next“.

Install and configure Matomo analysis platform on CentOS 8

root

The super user is the user you created when you installed Matomo. Don’t lose this information; this is the only way you can log in to Matomo for the first time. This user is the only super user in each Matomo installation. Super users can perform administrative tasks such as adding new websites to monitor, adding users, changing user permissions, and enabling and disabling plugins. This user has the highest authority. Choose your username and password and fill in the information, then click “next

Install and configure Matomo analysis platform on CentOS 8

Set up website

In this step, enter the name and URL of the first website you want to track. After the installation is complete, you can add more sites

Install and configure Matomo analysis platform on CentOS 8

JavaScript tracking code

To use Matomo to track your web traffic, you need to make sure that you add some extra code to each page. If your blog or website runs on a universal CMS, for example: WordPress | Square space | wax | SharePoint | Joomla | Shopify, Have Pre-made plug-ins That will do it for you. If there are no plugins for your use case, you will be provided with additional code to add them to the page before each closing tag. Click “next“After getting the code.

Install and configure Matomo analysis platform on CentOS 8

congratulations

Congratulations! Matomo installation is complete. Make sure to enter the JavaScript code on the page and wait for your first visitor! Scroll down and click “Continue to Matomo“. Log in with the super user details and you are ready to go.

Install and configure Matomo analysis platform on CentOS 8

Install and configure Matomo analysis platform on CentOS 8

If the Matomo JavaScript tracking tag is correctly installed on your website, you will receive real-time analysis data. If you have not received any data, please make sure that you have copied and pasted the Matomo Javascript code on your website page. (Source: Matomo)

This is all about installing Matomo Analytics on the CentOS 8 box. You can find out more about Matomo by checking their GitHub space And visit Matomo homepage.

Concluding words

Matomo Analytics provides an easy-to-use platform that anyone can use. You also get maximum flexibility, can do whatever you want, and gain powerful insights to grow your business without data limitations or without multiple web analysis tools. As always, give it a try and check if it will help your business or online project. Thanks for coming.

Marketing and digital analysis courses try:


Google Analytics certification: get certified and get more

Google Analytics certification: get certified and get more

★★★★☆
(10698)

$ 15.29

$ 152.87

In stock

Buy now

Install and configure Matomo analysis platform on CentOS 8Udemy.com


Complete Digital Marketing Course-12 courses in 1

Complete Digital Marketing Course-12 courses in 1

★★★★☆
(109420)

$ 16.46

$ 164.63

In stock

Buy now

Install and configure Matomo analysis platform on CentOS 8Udemy.com


Google Analytics training courses

Google Analytics training courses

★★★★☆
(5381)

$ 15.29

$ 152.87

In stock

Buy now

Install and configure Matomo analysis platform on CentOS 8Udemy.com

Please also read:

How to install Open Web Analytics on RHEL 8 / CentOS 8

How to install Matomo (Piwik) web analysis tool on Ubuntu

Install Fathom website analysis tool on Ubuntu/CentOS/Arch Linux

To
You can download this article in PDF format via the link below to support us.

Download the guide in PDF format

turn off
To

To
To

Sidebar