Simplification pour la portabilité entre Apache, Nginx, etc
This commit is contained in:
parent
0624805121
commit
4704492537
|
@ -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` :
|
||||
|
||||
~~~
|
||||
<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/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"
|
||||
</VirtualHost>
|
||||
~~~
|
||||
|
||||
### 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 :
|
||||
|
|
Loading…
Reference in New Issue