dortmundbvb0624 2018-10-21 22:02
浏览 193
已采纳

试图在Ubuntu 18.04 LTS上部署Symfony - setfacl不工作?

I'm following the guide here (admittedly it's a little dated) to deploy my first Symfony 4 project to production. It was going all good until I got to the file permissions. I did the steps specifically in Step 4 of the link :

sudo chown -R myuser:myuser /var/www/html
sudo chmod -R 750 /var/www/html
sudo setfacl -R -m u:www-data:rX /var/www/html/project
sudo setfacl -R -m u:www-data:rwX /var/www/html/project/var/cache /var/www/html/project/var/log
sudo setfacl -dR -m u:www-data:rwX /var/www/html/project/var/cache /var/www/html/project/var/log

That gives me

getfacl /var/www/html/project

# file: var/www/html/project/
# owner: myuser
# group: myuser
user::rwx
user:www-data:r-x
group::r-x
mask::r-x
other::---

and

getfacl /var/www/html/project/var/cache

# file: var/www/html/project/var/cache
# owner: myuser
# group: myuser
user::rwx
user:www-data:rwx
group::r-x
mask::rwx
other::---
default:user::rwx
default:user:www-data:rwx
default:group::r-x
default:mask::rwx
default:other::---

However when I go to run the web app I get a blank page and the error log shows

[crit] 3116#3116: *12 stat() "/var/www/html/project/public/" failed (13: Permission denied)

So it seems the setfacl isn't working? What am I doing wrong here? Is there a better guide for permissions?

  • 写回答

1条回答 默认 最新

  • duanba7653 2018-10-22 02:53
    关注

    Given the www-data user isn't a member of the myuser group, it requires +x permissions to descend through the /var/www/html directory. The existing permissions in the question are '750'. To change this:

    chmod o+x /var/www/html
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog