2017-04-23 15:51:21 +02:00
<chapter xmlns= "http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
2018-01-16 18:44:27 +01:00
xml:id="module-services-matomo">
2018-09-30 02:51:11 +02:00
<title > Matomo</title>
<para >
2019-09-19 19:17:30 +02:00
Matomo is a real-time web analytics application. This module configures
php-fpm as backend for Matomo, optionally configuring an nginx vhost as well.
2018-09-30 02:51:11 +02:00
</para>
<para >
2019-09-19 19:17:30 +02:00
An automatic setup is not suported by Matomo, so you need to configure Matomo
itself in the browser-based Matomo setup.
2018-09-30 02:51:11 +02:00
</para>
<section xml:id= "module-services-matomo-database-setup" >
<title > Database Setup</title>
2019-03-22 14:44:11 +01:00
2017-04-23 15:51:21 +02:00
<para >
2019-09-19 19:17:30 +02:00
You also need to configure a MariaDB or MySQL database and -user for Matomo
yourself, and enter those credentials in your browser. You can use
passwordless database authentication via the UNIX_SOCKET authentication
plugin with the following SQL commands:
2019-03-22 14:44:11 +01:00
<programlisting >
2019-06-17 12:01:51 +02:00
# For MariaDB
INSTALL PLUGIN unix_socket SONAME 'auth_socket';
CREATE DATABASE matomo;
CREATE USER 'matomo'@'localhost' IDENTIFIED WITH unix_socket;
GRANT ALL PRIVILEGES ON matomo.* TO 'matomo'@'localhost';
2017-08-01 01:23:02 +02:00
2019-06-17 12:01:51 +02:00
# For MySQL
INSTALL PLUGIN auth_socket SONAME 'auth_socket.so';
CREATE DATABASE matomo;
CREATE USER 'matomo'@'localhost' IDENTIFIED WITH auth_socket;
GRANT ALL PRIVILEGES ON matomo.* TO 'matomo'@'localhost';
</programlisting>
2019-09-19 19:17:30 +02:00
Then fill in <literal > matomo</literal> as database user and database name,
and leave the password field blank. This authentication works by allowing
only the <literal > matomo</literal> unix user to authenticate as the
<literal > matomo</literal> database user (without needing a password), but no
other users. For more information on passwordless login, see
<link xlink:href= "https://mariadb.com/kb/en/mariadb/unix_socket-authentication-plugin/" /> .
2018-09-30 02:51:11 +02:00
</para>
2017-08-01 01:23:02 +02:00
2018-09-30 02:51:11 +02:00
<para >
2019-09-19 19:17:30 +02:00
Of course, you can use password based authentication as well, e.g. when the
database is not on the same host.
2018-09-30 02:51:11 +02:00
</para>
</section>
2019-02-15 23:50:07 +01:00
<section xml:id= "module-services-matomo-archive-processing" >
2018-05-13 16:52:00 +02:00
<title > Archive Processing</title>
2019-03-22 14:44:11 +01:00
2018-05-13 16:52:00 +02:00
<para >
2019-09-19 19:17:30 +02:00
This module comes with the systemd service
<literal > matomo-archive-processing.service</literal> and a timer that
automatically triggers archive processing every hour. This means that you
can safely
<link xlink:href= "https://matomo.org/docs/setup-auto-archiving/#disable-browser-triggers-for-matomo-archiving-and-limit-matomo-reports-to-updating-every-hour" >
disable browser triggers for Matomo archiving </link> at
<literal > Administration > System > General Settings</literal> .
2018-05-13 16:52:00 +02:00
</para>
2019-03-22 14:44:11 +01:00
2018-05-13 16:52:00 +02:00
<para >
2019-09-19 19:17:30 +02:00
With automatic archive processing, you can now also enable to
<link xlink:href= "https://matomo.org/docs/privacy/#step-2-delete-old-visitors-logs" >
delete old visitor logs </link> at <literal > Administration > System >
Privacy</literal> , but make sure that you run <literal > systemctl start
matomo-archive-processing.service</literal> at least once without errors if
you have already collected data before, so that the reports get archived
before the source data gets deleted.
2018-05-13 16:52:00 +02:00
</para>
</section>
2018-09-30 02:51:11 +02:00
<section xml:id= "module-services-matomo-backups" >
<title > Backup</title>
2019-03-22 14:44:11 +01:00
2018-09-30 02:51:11 +02:00
<para >
2019-09-19 19:17:30 +02:00
You only need to take backups of your MySQL database and the
<filename > /var/lib/matomo/config/config.ini.php</filename> file. Use a user
in the <literal > matomo</literal> group or root to access the file. For more
information, see
<link xlink:href= "https://matomo.org/faq/how-to-install/faq_138/" /> .
2018-09-30 02:51:11 +02:00
</para>
</section>
<section xml:id= "module-services-matomo-issues" >
<title > Issues</title>
2019-03-22 14:44:11 +01:00
2018-09-30 02:51:11 +02:00
<itemizedlist >
<listitem >
2017-04-23 15:51:21 +02:00
<para >
2019-09-19 19:17:30 +02:00
Matomo will warn you that the JavaScript tracker is not writable. This is
because it's located in the read-only nix store. You can safely ignore
this, unless you need a plugin that needs JavaScript tracker access.
2017-04-23 15:51:21 +02:00
</para>
2018-09-30 02:51:11 +02:00
</listitem>
</itemizedlist>
</section>
<section xml:id= "module-services-matomo-other-web-servers" >
<title > Using other Web Servers than nginx</title>
<para >
2019-09-19 19:17:30 +02:00
You can use other web servers by forwarding calls for
<filename > index.php</filename> and <filename > piwik.php</filename> to the
2019-09-24 10:03:06 +02:00
<literal > <link linkend= "opt-services.phpfpm.pools._name_.socket" > services.phpfpm.pools.< name> .socket</link> </literal> fastcgi unix socket. You can use
2019-09-19 19:17:30 +02:00
the nginx configuration in the module code as a reference to what else
should be configured.
2018-09-30 02:51:11 +02:00
</para>
</section>
2017-04-23 15:51:21 +02:00
</chapter>