2

我在弹性 beanstalk 应用程序上安装了 phpmyadmin,我收到以下错误“配置文件的权限错误,不应该是世界可写的!”

每次我将代码部署到应用程序时,我都必须在服务器上手动更改文件权限,

我试图在 .ebextensions 文件夹中添加一个 .config 文件以sudo chmod 755 /path-to-file在日志中运行它看起来不错但实际上它仍然是 666

这是文件


.ebextensions/phpdb.config

container_commands:
    01_change_permissions:
        command: "sudo chmod 000755 /var/app/current/phpdb/config.inc.php"
        ignoreErrors: true
    02_change_permissions:
        command: "/opt/elasticbeanstalk/hooks/appdeploy/post/99_change_permissions.sh"
files:
  "/opt/elasticbeanstalk/hooks/appdeploy/post/99_change_permissions.sh":
    mode: "000755"
    owner: root
    group: root
    content: |
      #!/usr/bin/env bash
      sudo chmod 000755 /var/app/current/phpdb/config.inc.php

4

0 回答 0