How to install Matomo Analytics on Fedora 28

Source: Internet
Author: User
Tags piwik strong password

Matomo (formerly known as Piwik) is an open source analytics platform and an opening choice for Google Analytics. Matomo source code is hosted on GitHub. It is a full-featured Php/mysql software program that you can download and install on your own Web server. In this guide, we will install Matomo on a new Fedora Vultr server please add a link description instance.

Demand
Nginx.
PHP version 5.5.9 or later.
MySQL version 5.5 or later.
PHP expands PDO and pdo_mysql, or mysqli extensions.

Before you start
Check the Fedora version.
Cat/etc/fedora-release

Fedora release (twenty Eight)

Use sudo access to create a new non-root user account and switch to it.
Useradd-c "John Doe" JohnDoe && passwd JohnDoe
Usermod-ag Wheel JohnDoe
Su-johndoe
Note: Replace the johndoe with your user name.

Make sure your system is up to date.
sudo DNF Check-upgrade | | sudo DNF upgrade-y
Set the time zone.
sudo timedatectl set-timezone ' region/city '
Disable SELinux and firewalls.
sudo setenforce 0
sudo systemctl stop Firewalld
sudo systemctl disable FIREWALLD
Install PHP and the required PHP extensions

Matomo recommends using PHP 7 because it is more efficient and faster than the previous PHP version. The default Fedora repository contains PHP 7.2, so the installation will be simple.

Install PHP and the necessary PHP extensions.
sudo DNF install-y php php-fpm php-common php-curl php-gd php-cli php-mysqlnd php-xml php-mbstring Php-json
Check version
PHP--version

PHP 7.2.6 (CLI) (Built:may 2018 16:22:08) (NTS) Copyright (c) 1997-2018 the PHP groupzend Engine v3.2.0, Copyright (c ) 1998-2018 Zend Technologies

Installing MARIADB

sudo DNF install-y mariadb-server
Check version

MySQL--version

MySQL Ver 15.1 distrib 10.2.14-mariadb, for Linux (x86_64) using ReadLine 5.1

Start and enable MARIADB.
sudo systemctl start Mariadb.service
sudo systemctl enable Mariadb.service
Run the Mysql_secure_installation script to improve the security of the MARIADB installation.
sudo mysql_secure_installation
Log on to mariadb as the root user.
Mysql-u root-p

Enter Password:

Create a new MARIADB database and database user, and remember the credentials.
mysql> CREATE DATABASE db_name;
Mysql> GRANT all on db_name.* to ' username ' identified by ' password ';
mysql> FLUSH privileges;
Mysql> quit
Note: Replace the db_name and username with the name that is appropriate for your settings. Replace the password with a strong password.

Installing and configuring Nginx

Install Nginx.
sudo DNF install-y nginx
Check the version.
sudo nginx-v

Nginx version:nginx/1.12.1

Start and enable Nginx.
sudo systemctl start Nginx.service
sudo systemctl enable Nginx.service
Configure Nginx. Run sudo vim/etc/nginx/con.d/matomoconf and populate the file with the following configuration.
server {
Listen 80;

server_name stats.example.com;root /var/www/matomo;location / {    try_files $uri /index.php$is_args$args;}location ~ \.php$ {    try_files $uri =404;    include fastcgi_params;    fastcgi_pass unix:/run/php-fpm/ http://52kuaiyun.com/;    fastcgi_index index.php;    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}

}
Test the configuration.
sudo nginx-t
Reload Nginx.
sudo systemctl reload Nginx.service
Installing Matomo

Create a document root directory.
sudo mkdir-p/var/www/matomo
Change ownership of the/var/www/matomo directory to JohnDoe.
sudo chown-r Johndoe:johndoe/var/www/matomo
Download the latest version of Matomo.
Cd/var/www/matomo
wget https://builds.piwik.org/piwik.zip && Unzip Piwik.zip
RM Piwik.zip
MV piwik/*.
RmDir Piwik
Change ownership of the/var/www/matomo directory to Nginx.
sudo chown-r Nginx:nginx/var/www/matomo
Run sudo vim/etc/php-fpm.d/www.conf and set the user and group to Nginx. Initially, they will be set to Apache.
sudo vim/etc/php-fpm.d/www.conf

user = Nginxgroup = Nginx

Restart the PHP-FPM service.
sudo systemctl restart Php-fpm.service
Open your Web browser and navigate to the URL of the Matomo you have uploaded. You will see the "Matomo Installation Welcome screen". If there are any problems, Matomo will identify them and provide a solution. Follow the on-screen instructions to complete the Matomo installation.

How to install Matomo Analytics on Fedora 28

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.