AWS ECS:无法通过URL访问。授予您没有访问此资源的权限

时间:2020-02-20 04:45:43

标签: amazon-web-services docker drupal amazon-ecs

Dockerizing Drupal 8 on AWS ECS Error: Task failed ELB health checks in Target group for Drupal

上面的东西现在工作正常。似乎缺少Apache或PHP配置,因此无法访问该网站。

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

Apache/2.4.25 (Debian) Server at 51.11.211.110 Port 80

DockerFile

FROM drupal:8.6-apache

RUN apt-get update && apt-get install -y \
    curl \
    git \
    mysql-client \
    vim \
    wget

RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
    php composer-setup.php && \
    mv composer.phar /usr/local/bin/composer && \
    php -r "unlink('composer-setup.php');"

RUN wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/download/0.4.2/drush.phar && \
    chmod +x drush.phar && \
    mv drush.phar /usr/local/bin/drush

COPY apache-drupal.conf /etc/apache2/sites-enabled/000-default.conf

WORKDIR /drupal/web

docker-compose.yml文件

version: '3'
services:
  drupal:
    image: drupal:latest
    container_name: drupal
    build: .
    ports:
      - "8081:80"
    volumes:
      - ./:/drupal/web
    restart: always

apache-drupal.conf文件

<VirtualHost *:80>
    DocumentRoot "/drupal/web/"
    DirectoryIndex index.php

    <Directory "/drupal/web/">
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog /drupal/web/error.log
    CustomLog /drupal/web/access.log combined
</VirtualHost>

它给出了以上错误。可能是我在DockerFile中缺少的东西吗?

泊坞窗日志中的错误

无法提供目录/ var / www / web /:没有匹配的DirectoryIndex (index.php,index.html)以及服务器生成的目录索引 选项指令禁止

[UPDATE]

添加apache.conf文件后,出现以下错误消息

AH00014:配置检查失败没有这样的文件或目录: AH02291:由于错误而无法访问目录“ / var / www / web / docker / logs /” 在/etc/apache2/sites-enabled/000-default.conf:1

中定义的虚拟主机日志

现在我可以通过IP进行访问,但是它仅显示error.logaccess.log文件。不是我的Drupal项目

0 个答案:

没有答案