使用弹性 beantalk 将文件添加到 /etc/httpd/conf.d

Add file to /etc/httpd/conf.d with elastic beanstalk

我在项目的根目录中创建了一个 .ebextensions 目录并添加了一个 conf 文件以将文件添加到 /etc/httpd/conf.d 但是当我通过 ssh 连接到我的实例时我没有看到结果。我做了两次尝试:

(1) 第一次尝试

this AWS forum post 之后,我用以下内容创建了 .ebextensions/update.conf

files:
  "/etc/httpd/conf.d/update.conf":
    mode: "000644"
    owner: root
    group: root
    encoding: plain
    content: |
      TraceEnable off

我 运行 通过 YAML linter 确保格式正确。

(2) 第二次尝试

the AWS docs 之后,我用以下内容创建了 .ebextensions/httpd/conf.d/update.conf

TraceEnable off

在这两种情况下,文件 update.conf 都没有按要求出现在 /etc/httpd/conf.d/ 目录中。

为确保我的配置已正确上传,我下载了源 zip 文件以确保包含我的 .ebextensions 文件夹。

对我可能做错的地方有什么建议吗?

您的配置文件名为 .ebextensions/update.conf。但是,根据 Advanced Environment Customization with Configuration Files (.ebextensions),文件扩展名应该是 .config:

Configuration files are YAML- or JSON-formatted documents with a .config file extension that you place in a folder named .ebextensions and deploy in your application source bundle.

尝试将您的配置文件重命名为 .ebextensions/update.config