nixpkgs/nixos/modules/services/web-apps/matomo-doc.xml

96 lines
3.6 KiB
XML
Raw Normal View History

2017-04-23 14:51:21 +01: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 17:44:27 +00:00
xml:id="module-services-matomo">
2017-04-23 14:51:21 +01:00
2018-01-16 17:44:27 +00:00
<title>Matomo</title>
2017-04-23 14:51:21 +01:00
<para>
2018-01-16 17:44:27 +00: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.
2017-04-23 14:51:21 +01:00
</para>
<para>
2018-01-16 17:44:27 +00:00
An automatic setup is not suported by Matomo, so you need to configure Matomo itself in the browser-based Matomo setup.
2017-04-23 14:51:21 +01:00
</para>
2018-09-01 21:15:29 +01:00
<section xml:id="module-services-matomo-database-setup">
2017-04-23 14:51:21 +01:00
<title>Database Setup</title>
<para>
2018-01-16 17:44:27 +00:00
You also need to configure a MariaDB or MySQL database and -user for Matomo yourself,
2017-04-23 14:51:21 +01:00
and enter those credentials in your browser.
You can use passwordless database authentication via the UNIX_SOCKET authentication plugin
with the following SQL commands:
2017-04-23 14:51:21 +01:00
<programlisting>
# For MariaDB
2017-04-23 14:51:21 +01:00
INSTALL PLUGIN unix_socket SONAME 'auth_socket';
2018-01-16 17:44:27 +00:00
CREATE DATABASE matomo;
CREATE USER 'matomo'@'localhost' IDENTIFIED WITH unix_socket;
GRANT ALL PRIVILEGES ON matomo.* TO 'matomo'@'localhost';
# For MySQL
INSTALL PLUGIN auth_socket SONAME 'auth_socket.so';
2018-01-16 17:44:27 +00:00
CREATE DATABASE matomo;
CREATE USER 'matomo'@'localhost' IDENTIFIED WITH auth_socket;
GRANT ALL PRIVILEGES ON matomo.* TO 'matomo'@'localhost';
2017-04-23 14:51:21 +01:00
</programlisting>
2018-01-16 17:44:27 +00: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.
2017-04-23 14:51:21 +01:00
For more information on passwordless login, see
<link xlink:href="https://mariadb.com/kb/en/mariadb/unix_socket-authentication-plugin/" />.
</para>
<para>
Of course, you can use password based authentication as well, e.g. when the database is not on the same host.
</para>
</section>
2018-09-01 21:15:29 +01:00
<section xml:id="module-services-matomo-backups">
2017-04-23 14:51:21 +01:00
<title>Backup</title>
<para>
You only need to take backups of your MySQL database and the
2018-01-16 17:44:27 +00:00
<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/" />.
2017-04-23 14:51:21 +01:00
</para>
</section>
2018-09-01 21:15:29 +01:00
<section xml:id="module-services-matomo-issues">
2017-04-23 14:51:21 +01:00
<title>Issues</title>
<itemizedlist>
<listitem>
<para>
2018-01-16 17:44:27 +00:00
Matomo's file integrity check will warn you.
2017-04-23 14:51:21 +01:00
This is due to the patches necessary for NixOS, you can safely ignore this.
</para>
</listitem>
<listitem>
<para>
2018-01-16 17:44:27 +00:00
Matomo will warn you that the JavaScript tracker is not writable.
2017-04-23 14:51:21 +01:00
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.
</para>
</listitem>
</itemizedlist>
</section>
2018-09-01 21:15:29 +01:00
<section xml:id="module-services-matomo-other-web-servers">
2017-04-23 14:51:21 +01:00
<title>Using other Web Servers than nginx</title>
<para>
You can use other web servers by forwarding calls for <filename>index.php</filename> and
2018-01-16 17:44:27 +00:00
<filename>piwik.php</filename> to the <literal>/run/phpfpm-matomo.sock</literal> fastcgi unix socket.
2017-04-23 14:51:21 +01:00
You can use the nginx configuration in the module code as a reference to what else should be configured.
</para>
</section>
</chapter>