Matomo atau sebelumnya dikenal dengan nama Piwik adalah perangkat lunak open source untuk web analytics, berfungsi untuk melacak pengunjung di website. Matomo dapat menjadi alternatif dari Google Analytics yang menginginkan kendali penuh atas data statistik pengunjung website.
*Persyaratan sistem*
Untuk menjalankan Matomo membutuhkan persyaratan sistem:
· Web server Apache, Nginx, IIS, dsb · PHP versi >=5.5.9 · PHP extension pdo, pdo_mysql, atau mysqli · MySQL versi >=5.5 atau MariaDB
*Sistem yang direkomendasikan*
Sistem yang direkomendasikan untuk Matomo:
· PHP 7.x yang terbaru · PHP GD extension untuk generate grafik · MySQL 5.7+ atau MariaDB
*Ukuran server yang direkomendasikan*
Ukuran server yang direkomendasikan untuk Matomo:
-Tracking 100.000 page views per bulan-
· 1 server untuk database dan aplikasi · 2 CPU, 2GB RAM, 50GB SSD disk
-Tracking 1 juta page views per bulan-
· 1 server untuk database dan aplikasi · 4 CPU, 8GB RAM, 250GB SSD disk
-Tracking 10 juta page views per bulan-
· 1 server aplikasi, 8 CPU, 16GB RAM, 100GB SSD disk · atau 2 server aplikasi, 4 CPU, 4GB RAM, 100GB SSD disk · 1 server database, 8 CPU, 16GB RAM, 400GB SSD disk
-Tracking 100 juta page views per bulan-
· 3 server aplikasi, 16 CPU, 16 RAM, 100GB SSD disk · 1 server database, 16 CPU, 32GB RAM, 1TB SSD disk · atau optional 2 server database, satu sebagai replikasi slave · 1 load balancer · 1 CDN
-Tracking 100 juta page views per bulan-
· 3 server aplikasi, 16 CPU, 16GB RAM, 100GB SSD disk · 2 server database, 16 CPU, 32GB RAM, 1TB SSD disk · server database replikasi slave · 1 load balancer · 1 CDN
*Sistem yang digunakan di tutorial*
Sistem yang digunakan dalam tutorial ini:
· VPS 1CPU, 2GB RAM, 50GB SSD disk · Sistem operasi: Ubuntu 20.04 · Web server: Apache · PHP runtime: PHP 7.4 · Database: MariaDB 10.3 · Subdomain: matomo.defnex.com · SSL: Let’s Encrypt · Matomo: Matomo v3.14.0
*Install Apache*
Install Apache web server.
[INPUT]1 apt install apache2 -y
Membuat konfigurasi virtual host untuk *matomo.defnex.com*.
[INPUT]1 nano /etc/apache2/sites-available/matomo.defnex.com.conf
Konfigurasi virtual host.
[INPUT]1 2 3 4 5 6 7 8 9 10 11
Membuat direktori DocumentRoot.
[INPUT]1 mkdir /var/www/matomo.defnex.com
Mengaktifkan virtual host.
[INPUT]1 a2ensite matomo.defnex.com.conf
Restart Apache.
[INPUT]1 2 systemctl restart apache2 systemctl status apache2
*Install Let’s Encrypt SSL*
Install certbot untuk sertifikat SSL dari Let’s Encrypt.
[INPUT]1 snap install –classic certbot
Melakukan permintaan SSL untuk subdomain matomo.defnex.com.
[INPUT]1 certbot –apache -d matomo.defnex.com
*Install PHP*
Install PHP beserta extension.
[INPUT]1 apt install php php-common php-curl php-gd php-cli php-mysql php-xml php-mbstring libapache2-mod-php -y
Restart Apache.
[INPUT]1 systemctl restart apache2
*Install MariaDB*
Install MariaDB database.
[INPUT]1 apt install mariadb-server -y
Mengamankan instalasi MariaDB.
[INPUT]1 2 3 4 5 6 7 8 mysql_secure_installation Enter current password for root (enter for none): ENTER Set root password? [Y/n] y Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y
Login ke MariaDB.
[INPUT]1 mysql -u root -p
Membuat database dan user untuk Matomo.
[INPUT]1 2 3 4 5 CREATE DATABASE matomodb; CREATE USER ‘usermatomo’@’localhost’ IDENTIFIED BY ‘secret’; GRANT ALL PRIVILEGES ON matomodb.* TO ‘usermatomo’@’localhost’; FLUSH PRIVILEGES; EXIT
*Install Matomo*
Download Matomo.
[INPUT]1 wget https://builds.matomo.org/matomo.zip
Extract matomo.zip.
[INPUT]1 2 apt install unzip -y unzip matomo.zip
Copy file Matomo ke DocumentRoot.
[INPUT]1 cp -Rv matomo/* /var/www/matomo.defnex.com
Ubah ownership DocumentRoot.
[INPUT]1 chown -R www-data:www-data /var/www/matomo.defnex.com
Browse *https://matomo.defnex.com* untuk instalasi dan konfigurasi Matomo.
Klik *Next*.
Welcome Matomo installation
Pemeriksaan sistem, klik *Next* jika tidak ada masalah.
System check
Konfigurasi database, masukkan nama database, username, dan password yang telah dibuat.
Database setup
Membuat tabel, klik *Next*.
Creating the tables
Membuat akun Super User.
Lalu *Next*.
Super user account
Setup website pertama yang ingin dipantau.
Lalu *Next*.
Setup a website
Copy tracking code yang harus dipasang di website.
Lalu *Next*.
Tracking code
Instalasi Matomo telah selesai.
Klik *Continue To Matomo*.
Matomo installation is completed
Login menggunakan akun Super User.
Dashboard Matomo.
Matomo dashboard
Selamat mencoba ð