【发布时间】:2020-04-03 16:36:37
【问题描述】:
Ubuntu 18.04.4 LTS
varnishd -V
varnishd (varnish-6.4.0 revision 13f137934ec1cf14af66baf7896311115ee35598)
Copyright (c) 2006 Verdens Gang AS
Copyright (c) 2006-2020 Varnish Software AS
我学习 Varnish 的第一步,我已经尘埃落定了。
我在 /etc/systemd/system/varnish.service
准备了一个配置文件我正在尝试使用此配置启动 varnishd:
[Unit]
Description=Varnish HTTP accelerator
Documentation=https://www.varnish-cache.org/docs/4.1/ man:varnishd
[Service]
Type=simple
LimitNOFILE=131072
LimitMEMLOCK=82000
ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :6081 -b :8000 -T localh$
ExecReload=/usr/share/varnish/varnishreload
ProtectSystem=full
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
[Install]
WantedBy=multi-user.target
文件内容取自《Varnish Cache 入门》一书,但它是针对 4.1 版本的。
文档:https://varnish-cache.org/docs/6.4/users-guide/run_security.html#cli-interface-authentication
好吧,我已经准备好了文件。我输入命令:
varnishd -S /etc/systemd/system/varnish.service
Error: Neither -b nor -f given. (use -f '' to override)
(-? gives usage)
但是这个命令可以正常工作:
sudo varnishd -a localhost:6081 -b localhost:8000
你能帮我理解吗:
- 最简单的配置文件应该是什么样的。
- 应该放在哪里。
- 如何使用此配置启动 Varnish。
【问题讨论】:
标签: varnish