【问题标题】:Vagrant permissions Symfony流浪者权限 Symfony
【发布时间】:2015-10-25 14:13:48
【问题描述】:

我正在尝试使用“ubuntu/trusty64”框为 Symfony 项目设置 Vagrant。我的配置文件中有以下内容

echo "Installing acl"

apt-get install acl
mount -o remount,acl /

echo "Setting symfony log and cache permissions"

HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\  -f1`

setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX /var/www/app/cache /var/www/app/logs
setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX /var/www/app/cache /var/www/app/logs

但是 setfacl 失败了 setfacl: /var/www/app/cache: Operation not supported

如果我运行mount | grep acl,我可以看到根驱动器,这表明根分区上的 acl 设置正确。

如果没有这些权限设置,我将无法运行任何 symfony 生成器命令。

【问题讨论】:

    标签: php linux shell symfony vagrant


    【解决方案1】:

    我最终使用Vagrant folder permissions using nginx 的解决方案解决了这个问题,即将 nginx 用户更改为 vagrant。

    【讨论】:

      【解决方案2】:

      查看链接:http://symfony.com/doc/current/book/installation.html

      3.在不支持 chmod +a 的系统上使用 ACL

      有些系统不支持 chmod +a,但支持另一个名为 setfacl 的实用程序。您可能需要在分区上启用 ACL 支持并在使用之前安装 setfacl(与 Ubuntu 一样)。这使用一个命令来尝试确定您的 Web 服务器用户并将其设置为 HTTPDUSER:

      $ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\  -f1`
      $ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
      $ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
      

      【讨论】:

      • 这正是我正在做的事情(参见 shell 脚本中的 sn-p)。问题是它导致“setfacl: /var/www/app/cache: Operation not supported”
      • 2. 在支持 chmod +a 的系统上使用 ACL,解释如何在 /var/www/app/cache 上设置新权限
      猜你喜欢
      • 2016-01-29
      • 1970-01-01
      • 1970-01-01
      • 2015-01-05
      • 2022-01-26
      • 2014-07-04
      • 2015-02-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多