docker icon indicating copy to clipboard operation
docker copied to clipboard

applying ownership after reboot

Open michelwigbers opened this issue 2 years ago • 1 comments

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:

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. If you need more help, try Matomo.org.

This is since matomo version 4.13.1

 matomo:
    image: <myimage>
    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/<customer>-ssl.conf:/etc/apache2/sites-available/<customer>-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"

michelwigbers avatar Apr 26 '23 12:04 michelwigbers

Do your host and container www-data have the same uid/gid? Do you use SELinux or user namespaces?

J0WI avatar Jun 23 '23 14:06 J0WI