Création de la page HowtoMatomo
This commit is contained in:
parent
046cabeaea
commit
bc58b6db1a
|
@ -0,0 +1,110 @@
|
|||
---
|
||||
title: Howto Matomo
|
||||
categories: web webapp
|
||||
...
|
||||
|
||||
* Documentation : <https://matomo.org/faq/on-premise/matomo-requirements/>
|
||||
|
||||
Matomo est une application web affichant des statistiques de consultation de pages web tout en protégeant les données et la vie privée des internautes.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Il y a besoin de ces près-requis pour Debian 10 (Buster) :
|
||||
|
||||
~~~
|
||||
# apt install php php-curl php-gd php-cli php-mysql php-xml php-mbstring php-fpm apache2 libapache2-mpm-itk libapache2-mod-php
|
||||
~~~
|
||||
|
||||
### Compte UNIX
|
||||
|
||||
Créer un compte UNIX :
|
||||
|
||||
~~~
|
||||
# adduser matomo
|
||||
~~~
|
||||
|
||||
### Vhost Apache
|
||||
|
||||
Admettons que l'application sera accessible depuis https://domaine-matomo-instance.com.
|
||||
|
||||
On conseil au moins l'usage de ces directives dans `/etc/apache2/sites-enabled/matomo.conf` :
|
||||
|
||||
~~~
|
||||
<VirtualHost *:80 *:443>
|
||||
|
||||
ServerName domaine-matomo-instance.com
|
||||
|
||||
DocumentRoot /home/matomo/www/
|
||||
|
||||
SSLEngine on
|
||||
SSLProtocol all -SSLv2 -SSLv3
|
||||
SSLCertificateKeyFile /etc/letsencrypt/live/domaine-matomo-instance.com/privkey.pem
|
||||
SSLCertificateFile /etc/letsencrypt/live/domaine-matomo-instance.com/fullchain.pem
|
||||
|
||||
AssignUserID matomo matomo
|
||||
|
||||
CustomLog /var/log/apache2/access.log vhost_combined
|
||||
CustomLog /home/matomo/log/access.log combined
|
||||
ErrorLog /home/matomo/log/error.log
|
||||
|
||||
UseCanonicalName On
|
||||
RewriteEngine On
|
||||
RewriteCond %{HTTPS} !=on [OR]
|
||||
RewriteCond %{HTTP_HOST} !^domaine-matomo-instance.com$
|
||||
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
|
||||
|
||||
#php_admin_flag engine off
|
||||
#AddType text/html .html
|
||||
#php_admin_flag display_errors On
|
||||
#php_flag short_open_tag On
|
||||
#php_flag register_globals On
|
||||
#php_admin_value memory_limit 256M
|
||||
php_admin_value max_execution_time 60
|
||||
#php_admin_value upload_max_filesize 8M
|
||||
#php_admin_flag allow_url_fopen Off
|
||||
#php_value default_charset ISO-8859-15
|
||||
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f matomo"
|
||||
php_admin_value open_basedir "/usr/share/php:/home/matomo:/tmp"
|
||||
</VirtualHost>
|
||||
~~~
|
||||
|
||||
## Du chiffrement
|
||||
|
||||
On utilise certbot pour mettre du Let's Encrypt qui nous délivrera des certificats SSL :
|
||||
|
||||
~~~
|
||||
certbot certonly --webroot --webroot-path /var/lib/letsencrypt -d domaine-matomo-instance.com
|
||||
~~~
|
||||
|
||||
## Déployer l'application
|
||||
|
||||
Se connecter avec le compte UNIX et télécharger matomo et le dézipper comme ceci :
|
||||
|
||||
~~~
|
||||
# su - matomo
|
||||
$ wget https://builds.matomo.org/matomo.zip && unzip matomo.zip
|
||||
$ mv -i matomo www
|
||||
~~~
|
||||
|
||||
Il reste à suivre les instructions de son installation via https://domaine-matomo-instance.com
|
||||
|
||||
### Forcer le SSL
|
||||
|
||||
Pour augmenter d'un cran le niveau de sécurité, on ajoute dans `/home/matomo/www/config/config.ini.php` ces directives :
|
||||
|
||||
~~~
|
||||
[General]
|
||||
force_ssl = 1
|
||||
~~~
|
||||
|
||||
### Activer l'archivage
|
||||
|
||||
Désactiver l'archivage via l'interface web dans : *administration (roue cranté)* -> *Système* -> *paramètres généraux* -> *Paramètres d'archivage* -> mettre sur *Non*
|
||||
|
||||
Puis ajouter cette tâche dans la crontab de l'utilisateur :
|
||||
|
||||
~~~
|
||||
MAITO="foo@bar.com"
|
||||
30 * * * * /usr/bin/php /home/matomo/www/console core:archive --url=https://domaine-matomo-instance.com
|
||||
~~~
|
Loading…
Reference in New Issue