From 4704492537f1739ed99cc7139df86e5312dc3c60 Mon Sep 17 00:00:00 2001 From: btatu Date: Fri, 22 Jul 2022 12:01:45 +0200 Subject: [PATCH] =?UTF-8?q?Simplification=20pour=20la=20portabilit=C3=A9?= =?UTF-8?q?=20entre=20Apache,=20Nginx,=20etc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HowtoMatomo.md | 76 +++++--------------------------------------------- 1 file changed, 7 insertions(+), 69 deletions(-) diff --git a/HowtoMatomo.md b/HowtoMatomo.md index 7c96d4d6..bd54144f 100644 --- a/HowtoMatomo.md +++ b/HowtoMatomo.md @@ -8,90 +8,28 @@ categories: web webapp 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 +## Près-requis 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 +# apt install php php-curl php-gd php-cli php-mysql php-xml php-mbstring ~~~ -## Configuration +## Déployer -### Compte UNIX - -Créer un compte UNIX : +Se connecter avec le compte UNIX dédié, télécharger l'application et le dézipper en supposant que le DocumentRoot soit par exemple `/home/compte_unix/www/` : ~~~ -# 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` : - -~~~ - - - 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/cert.pem - SSLCertificateChainFile /etc/letsencrypt/live/domaine-matomo-instance.com/chain.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" - -~~~ - -### Chiffrement HTTPS - -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 +# su - compte_unix $ 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 +## Paramètrage + ### 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 :