matomo-org / matomo-org/docker

applying ownership after reboot

Open
#316 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Shell
Stars
1k
Forks
384
PR merge metrics
No merged PRs in 30d

Description

after reboot of the vm we have to apply the following:
An error occurred
Matomo couldn't write to some directories (running as user 'www-data').
Try to Execute the following commands on your server, to allow Write access on these directories:
```shell
chown -R www-data:www-data /var/www/html
find /var/www/html/tmp/assets -type f -exec chmod 644 {} \;
find /var/www/html/tmp/assets -type d -exec chmod 755 {} \;
find /var/www/html/tmp/logs -type f -exec chmod 644 {} \;
find /var/www/html/tmp/logs -type d -exec chmod 755 {} \;
find /var/www/html/tmp/tcpdf -type f -exec chmod 644 {} \;
find /var/www/html/tmp/tcpdf -type d -exec chmod 755 {} \;
find /var/www/html/tmp/templates_c -type f -exec chmod 644 {} \;
find /var/www/html/tmp/templates_c -type d -exec chmod 755 {} \;
```
If this doesn't work, you can try to create the directories with your FTP software, and set the CHMOD to 0755 (or 0777 if 0755 is not enough). To do so with your FTP software, right click on the directories then click permissions.
After applying the modifications, you can [refresh the page](https://analytics.ommelanderziekenhuis.nl/index.php).
If you need more help, try [Matomo.org](https://matomo.org/).

This is since matomo version 4.13.1

```dockerfile
matomo:
image:
restart: always
container_name: matomo
volumes:
- '/data/matomo/html/config/:/var/www/html/config/'
- '/data/matomo/apache2/ssl:/etc/apache2/ssl'
- '/data/matomo/apache2/sites-available/-ssl.conf:/etc/apache2/sites-available/-ssl.conf'
- '/data/matomo/plugins/TagManager:/var/www/html/plugins/TagManager'
environment:
- MATOMO_DATABASE_HOST=mysql
env_file:
- ./matomo.env
ports:
- target: 443
published: 443
protocol: 'tcp'
mode: 'host'
networks:
- papo
logging:
driver: "json-file"
options:
max-size: "20m"
max-file: "3"

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the posted Dockerfile configuration and its mounted /var/www/html paths, then reproduce the ownership change after a VM reboot. Trace how the mounted config, plugin, and related directories are owned when the container starts; done means Matomo no longer shows the write-permission error after reboot without manually rerunning the listed chown and chmod commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, shell
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.