0

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

我的堆栈是 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

任何提示或帮助将不胜感激。谢谢。

4

1 回答 1

0

用户 ( vcache) 可能无权读取父目录/var/www/bazaar

于 2018-12-20T17:49:44.060 回答