mautic / docker-mautic

Docker Image for Mautic
https://www.mautic.org
374 stars 278 forks source link

You don't have permission to access this resource. - docker-compose #296

Open debek opened 1 month ago

debek commented 1 month ago

Hi,

I believe the embedded Apache in the image might have a misconfiguration, as it seems to cause this issue by design.

Container log:

mautic | [Sat Sep 14 18:36:14.211741 2024] [autoindex:error] [pid 27] [client 192.168.65.1:47147] AH01276: Cannot serve directory /var/www/html/docroot/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive mautic | 192.168.65.1 - - [14/Sep/2024:18:36:14 +0000] "GET / HTTP/1.1" 403 492 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"

Browser:

Forbidden You don't have permission to access this resource.

Curl:

ccurl http://localhost:8083/

  • Host localhost:8083 was resolved.
  • IPv6: ::1
  • IPv4: 127.0.0.1
  • Trying [::1]:8083...
  • Connected to localhost (::1) port 8083

    GET / HTTP/1.1 Host: localhost:8083 User-Agent: ccurl Accept: / Cache-Control: no-cache

  • Request completely sent off < HTTP/1.1 403 Forbidden < Date: Sat, 14 Sep 2024 18:42:00 GMT < Server: Apache/2.4.59 (Debian) < Content-Length: 276 < Content-Type: text/html; charset=iso-8859-1 < { [276 bytes data]
  • Connection #0 to host localhost left intact

docker-compose.yaml

networks:
  apps-network:
    external: true
    name: apps-network
  internal-network:
    driver: bridge
volumes:
  mautic_data:
  mauticdb_data:

services:
  mautic:
    container_name: mautic
    image: mautic/mautic:5.1-apache
    restart: always
    # Comment out the ports section if you are using a reverse proxy
    ports:
      - "8083:80"
    environment:
      MAUTIC_DB_HOST: mauticdb
      MAUTIC_DB_USER: XXX
      MAUTIC_DB_PASSWORD: XXX
      MAUTIC_DB_NAME: XXX
      MAUTIC_RUN_CRON_JOBS: 'true'
    volumes:
      - ./mautic_data:/var/www/html
    networks:
        - internal-network
        - apps-network

  mauticdb:
    container_name: mauticdb
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: XXX
      MYSQL_DATABASE: XXX
      MYSQL_USER: XXX
      MYSQL_PASSWORD: XXX
    volumes:
      - ./db_data:/var/lib/mysql
    networks:
        - internal-network