Metainformationen zur Seite
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
digitales:software:docker:matomo [20.10.2023] – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | digitales:software:docker:matomo [25.05.2025] (aktuell) – cs | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== matomo ====== | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | ===== Installation ===== | ||
+ | |||
+ | Die folgende Konfiguration legt eine mariadb, die app und das Webinterface unter nginx an. Die matomo Konfiguration liegt dann unter: | ||
+ | |||
+ | <code -> | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Im Verzeichnis / | ||
+ | |||
+ | ++++ docker-compose.yaml | ||
+ | |||
+ | <code yaml docker-compose.yaml> | ||
+ | version: " | ||
+ | |||
+ | services: | ||
+ | db: | ||
+ | image: mariadb: | ||
+ | command: --max-allowed-packet=64MB | ||
+ | restart: always | ||
+ | volumes: | ||
+ | - db:/ | ||
+ | environment: | ||
+ | - MYSQL_ROOT_PASSWORD=< | ||
+ | - MARIADB_AUTO_UPGRADE=1 | ||
+ | - MARIADB_DISABLE_UPGRADE_BACKUP=1 | ||
+ | env_file: | ||
+ | - ./db.env | ||
+ | |||
+ | app: | ||
+ | image: matomo: | ||
+ | restart: always | ||
+ | links: | ||
+ | - db | ||
+ | volumes: | ||
+ | # - ./ | ||
+ | # - ./ | ||
+ | - matomo:/ | ||
+ | environment: | ||
+ | - MATOMO_DATABASE_HOST=db | ||
+ | - PHP_MEMORY_LIMIT=2048M | ||
+ | env_file: | ||
+ | - ./db.env | ||
+ | |||
+ | web: | ||
+ | image: nginx: | ||
+ | restart: always | ||
+ | volumes: | ||
+ | - matomo:/ | ||
+ | # see https:// | ||
+ | - ./ | ||
+ | ports: | ||
+ | - 8083:80 | ||
+ | |||
+ | volumes: | ||
+ | db: | ||
+ | matomo: | ||
+ | </ | ||
+ | |||
+ | ++++ | ||
+ | |||
+ | ++++ db.env | | ||
+ | |||
+ | <code txt db.env> | ||
+ | MYSQL_PASSWORD=< | ||
+ | MYSQL_DATABASE=matomo | ||
+ | MYSQL_USER=cs | ||
+ | MATOMO_DATABASE_ADAPTER=mysql | ||
+ | MATOMO_DATABASE_TABLES_PREFIX=matomo_ | ||
+ | MATOMO_DATABASE_USERNAME=cs | ||
+ | MATOMO_DATABASE_PASSWORD=< | ||
+ | MATOMO_DATABASE_DBNAME=matomo | ||
+ | MARIADB_AUTO_UPGRADE=1 | ||
+ | MARIADB_INITDB_SKIP_TZINFO=1 | ||
+ | </ | ||
+ | |||
+ | ++++ | ||
+ | |||
+ | ++++ matomo.conf | | ||
+ | |||
+ | <code - matomo.conf> | ||
+ | upstream php-handler { | ||
+ | server app:9000; | ||
+ | } | ||
+ | |||
+ | server { | ||
+ | listen 80; | ||
+ | |||
+ | add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance | ||
+ | root / | ||
+ | index index.php; | ||
+ | try_files $uri $uri/ =404; | ||
+ | |||
+ | ## only allow accessing the following php files | ||
+ | location ~ ^/ | ||
+ | # regex to split $uri to $fastcgi_script_name and $fastcgi_path | ||
+ | fastcgi_split_path_info ^(.+\.php)(/ | ||
+ | |||
+ | # Check that the PHP script exists before passing it | ||
+ | try_files $fastcgi_script_name =404; | ||
+ | |||
+ | include fastcgi_params; | ||
+ | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
+ | fastcgi_param PATH_INFO $fastcgi_path_info; | ||
+ | fastcgi_param HTTP_PROXY ""; | ||
+ | fastcgi_pass php-handler; | ||
+ | } | ||
+ | |||
+ | ## deny access to all other .php files | ||
+ | location ~* ^.+\.php$ { | ||
+ | deny all; | ||
+ | return 403; | ||
+ | } | ||
+ | |||
+ | ## disable all access to the following directories | ||
+ | location ~ / | ||
+ | deny all; | ||
+ | return 403; # replace with 404 to not show these directories exist | ||
+ | } | ||
+ | location ~ /\.ht { | ||
+ | deny all; | ||
+ | return 403; | ||
+ | } | ||
+ | |||
+ | location ~ js/ | ||
+ | expires off; | ||
+ | add_header Cache-Control ' | ||
+ | } | ||
+ | |||
+ | location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { | ||
+ | allow all; | ||
+ | ## Cache images, | ||
+ | ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade | ||
+ | expires 1h; | ||
+ | add_header Pragma public; | ||
+ | add_header Cache-Control " | ||
+ | } | ||
+ | |||
+ | location ~ / | ||
+ | deny all; | ||
+ | return 403; | ||
+ | } | ||
+ | |||
+ | ## properly display textfiles in root directory | ||
+ | location ~/ | ||
+ | default_type text/plain; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | # vim: filetype=nginx | ||
+ | </ | ||
+ | |||
+ | ++++ | ||
+ | |||
+ | ===== GeoLocation ===== | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||