matomo-org/docker

HTTP ERROR 500

jtomasrl opened this issue · 3 comments

I'm using the docker-compose file from the examples directory an configured it according to my preferences, the thing is I'm getting HTTP Code 500 when trying to connect to Matomo.

I've install this on GCP using the smallest machine available for testing purposes, currently running 3.11-fpm-alpine

[23-Aug-2019 17:04:15] NOTICE: fpm is running, pid 1
[23-Aug-2019 17:04:15] NOTICE: ready to handle connections
172.18.0.4 -  23/Aug/2019:17:04:20 +0000 "GET /index.php" 500

matomo.conf: default
db.env

MYSQL_PASSWORD=123
MYSQL_DATABASE=matomo
MYSQL_USER=matomo
MATOMO_DATABASE_ADAPTER=mysql
MATOMO_DATABASE_TABLES_PREFIX=matomo_
MATOMO_DATABASE_USERNAME=matomo
MATOMO_DATABASE_PASSWORD=
MATOMO_DATABASE_DBNAME=matomo

docker-compose.yml

version: '3'

services:
  db:
    container_name: mariadb
    image: mariadb
    command: --max-allowed-packet=64MB
    restart: always
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=123
    env_file:
      - ./db.env

  app:
    container_name: matomo
    image: matomo:3.11-fpm-alpine
    restart: always
    links:
      - db
    volumes:
      - ./config:/var/www/html/config:rw
      - ./logs:/var/www/html/logs
      - matomo:/var/www/html
    environment:
      - MATOMO_DATABASE_HOST=db
    env_file:
      - ./db.env

  web:
    container_name: nginx
    image: nginx:alpine
    restart: always
    volumes:
      - matomo:/var/www/html:ro
      - ./matomo.conf:/etc/nginx/conf.d/default.conf:ro
    ports:
      - 8080:80

volumes:
  db:
  matomo:

ok so I just had to comment out
- ./config:/var/www/html/config:rw
- ./logs:/var/www/html/logs

zed0 commented

For anyone else who comes across this issue I found it to be because I didn't have the executable bit set on my logs and config directories. After some brief investigation I also noticed that the user writing to the directories within the docker instance is different to the user outside them.

Running chmod o+rwX config && chmod o+rwX logs solved the issue for me, but that may not be acceptable in terms of security depending on your scenario.

J0WI commented

PHP needs rw permission on the mounted folders.