varnish中DAEMON_OPTS在哪里?

并不是每个人都会热情的告诉你这个答案的,当然,我一定会告诉你。

最开始是在安装完varnish后,会有个配置,我根据magento的开发者文档进行配置,中间有提到

DAEMON_OPTS="-a :80 \
   -T localhost:6082 \
   -f /etc/varnish/default.vcl \
   -S /etc/varnish/secret \
   -s malloc,256m"

最开始我在default.vcl里面没有看到,然后再看下varnish.params这个里面,貌似没有,其实上面的这个东西就在varnish.params这个文件中,只是展示的方式不一样。DAEMON_OPTS包含-a参数的正确侦听端口(即使VARNISH_LISTEN_PORT设置为正确的值),在varnish.params这个文件中就有

# Main configuration file. You probably want to change it.
VARNISH_VCL_CONF=/etc/varnish/default.vcl   //相当于-f
# Default address and port to bind to. Blank address means all IPv4
# and IPv6 interfaces, otherwise specify a host name, an IPv4 dotted
# quad, or an IPv6 address in brackets.
# VARNISH_LISTEN_ADDRESS=192.168.1.5
VARNISH_LISTEN_PORT=80   //相当于-a

# Admin interface listen address and port
VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
VARNISH_ADMIN_LISTEN_PORT=6082

# Shared secret file for admin interface
VARNISH_SECRET_FILE=/etc/varnish/secret   //相当于-S

# Backend storage specification, see Storage Types in the varnishd(5)
# man page for details.
VARNISH_STORAGE="malloc,1G"   //相当于-s

# User and group for the varnishd worker processes
VARNISH_USER=varnish
VARNISH_GROUP=varnish

# Other options, see the man page varnishd(1)
#DAEMON_OPTS="-p thread_pool_min=5 -p thread_pool_max=500 -p thread_pool_timeout=300"

所以,其他的一一对应就行,中间会有一些备注,忽略即可。

未经允许不得转载:哈勃私语 » varnish中DAEMON_OPTS在哪里?

本文共1179个字 创建时间:2017年9月15日15:25   

分享到:更多 ()

相关推荐

  • 暂无文章