清漆4.1 default.vcl权限被拒绝

时间:2018-03-21 14:26:52

标签: magento2 varnish varnish-4 magento2.2

当我尝试通过创建符号链接添加magento 2 varnish.vcl文件时,清漆服务停止使用错误权限被拒绝,而如果我使用默认清漆配置文件清漆工作顺利。

My Stack是ubuntu 16.04,清漆4.1

ls -al 

drwxr-xr-x  2 root root 4096 Mar 21 13:14 .
drwxr-xr-x 96 root root 4096 Mar 21 12:56 ..
lrwxrwxrwx  1 root root   44 Mar 21 13:14 default.vcl -> /var/www/bazaar/varnish.vcl
-rw-r--r--  1 root root 1225 Aug 22  2017 default.vcl_bak
-rw-r--r--  1 root root   37 Mar 21 12:56 secret

这是清漆服务的状态

 ● varnish.service - Varnish HTTP accelerator
   Loaded: loaded (/lib/systemd/system/varnish.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/varnish.service.d
           └─customexec.conf
   Active: failed (Result: exit-code) since Wed 2018-03-21 13:59:08 UTC; 2s ago
     Docs: https://www.varnish-cache.org/docs/4.1/
           man:varnishd
  Process: 3093 ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m (code=exited, status=2)
 Main PID: 3093 (code=exited, status=2)

Mar 21 13:59:08 bazaar systemd[1]: Stopped Varnish HTTP accelerator.
Mar 21 13:59:08 bazaar systemd[1]: Started Varnish HTTP accelerator.
Mar 21 13:59:08 bazaar varnishd[3093]: Error: Cannot read -f file (/etc/varnish/default.vcl): Permission denied
Mar 21 13:59:08 bazaar systemd[1]: varnish.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Mar 21 13:59:08 bazaar systemd[1]: varnish.service: Unit entered failed state.
Mar 21 13:59:08 bazaar systemd[1]: varnish.service: Failed with result 'exit-code'.

我目前的nginx用户是bazaar

和varnish.vcl的权限如下

-rw-r--r--  1 bazaar bazaar 7226 Mar 21 13:24 varnish.vcl

任何提示或帮助都将受到高度赞赏。 感谢。

1 个答案:

答案 0 :(得分:0)

用户(vcache)可能无权读取父目录/var/www/bazaar中的内容。