File matomo-README.SUSE of Package matomo

a) mariadb/mysql
$ mysql -u adminusername -p
mysql> CREATE DATABASE _matomo_db_name_here_;
mysql> CREATE USER 'matomo'@'localhost' IDENTIFIED BY '_password_';
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON _matomo_db_name_here_.* TO 'matomo'@'localhost';

Replace _matomo_db_name_here_ with the name of your MySQL database (if possible, this database should only have the Matomo tables installed).
Replace _password_ with your password.

b) apache
In /etc/apache2/conf.d/matomo.conf you must insert your domain.

  Apache22: Allow from .mydomain.de
  Apache24: Require host mydomain.de

Enable needed modules:
~# for module in php7 headers setenvif ; do
~#	/usr/sbin/a2enmod $module
~# done

If you also want to enable compression, just enable the following modules as well:
~# /usr/sbin/a2enmod deflate
~# /usr/sbin/a2enmod filter

And then restart or reload apache
  
~# /usr/bin/systemctl restart apache2

c) installer
Go to http://www.mydomain.de/matomo/

At mysql-setup use mysqli not pod.


d) Attention:
You must disable caching for matomo.

Example for APC
   you can insert php_flag apc.cache_by_default Off in /etc/apache2/conf.d/matomo.conf like:

	<Directory "/srv/www/matomo">
    	AllowOverride All
    	Options FollowSymLinks
    
    	php_flag apc.cache_by_default Off
    
    	<IfModule mod_authz_core.c>
        ...

e) php
To prevent some critical issue, you must set the following in your php.ini file: 
  always_populate_raw_post_data=-1
After making this change, restart your web server

f) auto archiving
For autoarchiving you have two options.
With cron or with systemd.timer.
For cron you must uncomment the line in /etc/cron.d/matomo-archive
For systemd.timer you must start and enable matomo-archive.timer:
~# /usr/bin/systemctl enable --now matomo-archive.timer

g) Enable infile
   - GRANT FILE ON *.* TO '<your_matomo_user>'@'localhost'
   - usermod -a -G www mysql
   - systemctl restart mysql apache2
openSUSE Build Service is sponsored by