我正在Apache 2.4上使用Centos 6.8,并且我可以轻松地为我的Magento 2站点安装清漆并正确配置所有内容。

我已经安装了SLL证书,所以将-p feature=+esi_ignore_https添加到了sysconfig文件中。

一开始一切都很好

>  service varnish restart
>  Stopping Varnish Cache:                       [  OK  ]
>  Starting Varnish Cache:                       [  OK  ]


然后,当我使用以下命令启动Varnish CLI时

> varnishd -d -f /etc/varnish/default.vcl
>
> Type 'help' for command list.
> Type 'quit' to close CLI session.
> Type 'start' to launch worker process.
>
> **socket(): Address family not supported by protocol**


当我进入开始时,我会得到无尽的循环

Child cleanup complete
socket(): Address family not supported by protocol
child (30530) Started
Child (30530) said Child starts
Child (30530) died signal=6
Child (30530) Panic message:
Assert error in vca_acct(), cache/cache_acceptor.c line 386:
  Condition((listen(ls->sock, cache_param->listen_depth)) == 0) not true.
errno = 98 (Address already in use)
thread = (cache-acceptor)
version = varnish-4.0.4 revision 386f712
ident = Linux,2.6.32-042stab113.11,x86_64,-smalloc,-smalloc,-hcritbit,epoll
Backtrace:
  0x432425: varnishd() [0x432425]
  0x40d71d: varnishd() [0x40d71d]
  0x7f105722aaa1: /lib64/libpthread.so.0(+0x7aa1) [0x7f105722aaa1]
  0x7f1056f77bcd: /lib64/libc.so.6(clone+0x6d) [0x7f1056f77bcd]


另外当我尝试登录varnishlog时


  无法打开VSM文件(废弃的VSM文件(清漆未运行?)
  /var/lib/varnish/patriciasouths.com/_.vsm)

最佳答案

服务清漆启动
正在启动Varnish缓存:错误:无法打开套接字::6081:协议不支持地址族

所以这真是愚蠢..默认安装是这个..

DAEMON_OPTS="-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \
             -f ${VARNISH_VCL_CONF} \
             -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \
             -p thread_pool_min=${VARNISH_MIN_THREADS} \
             -p thread_pool_max=${VARNISH_MAX_THREADS} \
             -S ${VARNISH_SECRET_FILE} \
             -s ${VARNISH_STORAGE}"


在这里,我们有一个变量可以使用$ {VARNISH_LISTEN_ADDRESS} ...但是它不是以前定义的!

# Telnet admin interface listen address and port
VARNISH_ADMIN_LISTEN_PORT=6082


DOH!因此添加它。

# Telnet admin interface listen address and port
VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
VARNISH_ADMIN_LISTEN_PORT=6082


启动清漆缓存:[OK]

varnish.x86_64 0:4.1.10-1.el6从https://packagecloud.io/varnishcache/varnish41/el/6/SRPMS失败

07-24 17:54