dqrnsg6439 2015-10-25 14:13 采纳率: 100%
浏览 72

流浪的权限Symfony

I'm trying to setup Vagrant with a Symfony project using the box "ubuntu/trusty64". I have the following inside my provisioning file

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

However setfacl is failing with setfacl: /var/www/app/cache: Operation not supported

If I run mount | grep acl I can see the root drive which suggests acl is correct setup on the root partition.

Without these permissions setup I am unable to run any of the symfony generator commands.

  • 写回答

2条回答 默认 最新

  • douli4852 2015-10-25 14:31
    关注

    Check link : http://symfony.com/doc/current/book/installation.html

    3. Using ACL on a system that does not support chmod +a

    Some systems don't support chmod +a, but do support another utility called setfacl. You may need to enable ACL support on your partition and install setfacl before using it (as is the case with Ubuntu). This uses a command to try to determine your web server user and set it as 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
    
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题