我正在尝试将Varnish-4.1安装到magento-1.9,清漆工作正常,但当我尝试在管理 - >系统 - >缓存管理中单击btn时,它会在标题中显示错误:无法应用VCL到127.0.0.1:6082:无法从Varnish读取响应代码
操作系统:Ubuntu 18.04 Apache:2.4.29(Ubuntu)端口:8080 PHP 7.1.28-1 + ubuntu18.04.1 Magento ver。 1.9.4.1 清漆-4.1.11端口80来自:https://packagecloud.io/varnishcache/varnish41/install#manual-deb
/etc/systemd/system/varnish.service的内容
[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 :80 -T 127.0.0.1:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m -p vcc_allow_inline_c=on -p feature=+esi_ignore_other_elements -p feature=+esi_disable_xml_check
ExecReload=/usr/share/varnish/reload-vcl
ProtectSystem=full
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
[Install]
WantedBy=multi-user.target
sudo systemctl状态清漆
● varnish.service - Varnish HTTP accelerator
Loaded: loaded (/etc/systemd/system/varnish.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/varnish.service.d
└─override.conf
Active: active (running) since Tue 2019-04-16 16:13:42 CEST; 24min ago
Docs: https://www.varnish-cache.org/docs/4.1/
man:varnishd
Main PID: 31280 (varnishd)
Tasks: 218 (limit: 4915)
CGroup: /system.slice/varnish.service
├─31280 /usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T 127.0.0.1:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m -p vcc_allow_inline_c=on -p feature=+esi_ignore_other_elements -p feature=+esi_disable_xml_check
└─31385 /usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T 127.0.0.1:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m -p vcc_allow_inline_c=on -p feature=+esi_ignore_other_elements -p feature=+esi_disable_xml_check
Apr 16 16:26:07 ubuntu varnishd[31280]: CLI telnet 127.0.0.1 37242 127.0.0.1 6082 Rd "ban" "obj.http.X-Varnish-Session" "==" "i0fmpqecahms4mi8olvi3uamk5" "&&" "obj.http.X-Turpentine-Flush-Events" "~" "core_session_abstract_add_message"
Apr 16 16:26:07 ubuntu varnishd[31280]: CLI telnet 127.0.0.1 37242 127.0.0.1 6082 Wr 200
Apr 16 16:26:16 ubuntu varnishd[31280]: CLI telnet 127.0.0.1 37246 127.0.0.1 6082 Rd "auth" "long key"
Apr 16 16:26:16 ubuntu varnishd[31280]: CLI telnet 127.0.0.1 37246 127.0.0.1 6082 Wr 200 -----------------------------
Varnish Cache CLI 1.0
-----------------------------
Linux,4.18.0-17-generic,x86_64,-junix,-smalloc,-smalloc,-hcritbit
varnish-4.1.11 revision 61367ed17d08a9ef80a2d42dc84caef79cdeee7a
Type 'help' for command list.
Type 'quit' to close CLI session.
Apr 16 16:26:16 ubunut varnishd[31280]: CLI telnet 127.0.0.1 37246 127.0.0.1 6082 Rd "param.show" "feature"
Apr 16 16:26:16 ubuntu varnishd[31280]: CLI telnet 127.0.0.1 37246 127.0.0.1 6082 Wr 200 feature
Value is: +esi_disable_xml_check,+esi_ignore_other_elements
Default is: none
Enable/Disable various minor features.
none Disable all features.
Use +/- prefix to enable/disable individual feature:
short_panic Short panic message.
wait_silo Wait for persistent silo.
no_coredump No coredumps.
esi_ignore_https Treat HTTPS as HTTP in
ESI:includes
esi_disable_xml_check Don't check of body looks like
XML
esi_ignore_other_elements Ignore non-esi XML-elements
esi_remove_bom Remove UTF-8 BOM
https_scheme Also split https URIs
Apr 16 16:26:16 ubuntu varnishd[31280]: CLI telnet 127.0.0.1 37248 127.0.0.1 6082 Rd "auth" "long key"
Apr 16 16:26:16 ubuntu varnishd[31280]: CLI telnet 127.0.0.1 37248 127.0.0.1 6082 Wr 200 -----------------------------
Varnish Cache CLI 1.0
-----------------------------
Linux,4.18.0-17-generic,x86_64,-junix,-smalloc,-smalloc,-hcritbit
varnish-4.1.11 revision 61367ed17d08a9ef80a2d42dc84caef79cdeee7a
Type 'help' for command list.
Type 'quit' to close CLI session.
Apr 16 16:26:16 ubuntu varnishd[31280]: CLI telnet 127.0.0.1 37248 127.0.0.1 6082 Rd "ban" "obj.http.X-Varnish-Session" "==" "i0fmpqecahms4mi8olvi3uamk5" "&&" "obj.http.X-Turpentine-Flush-Events" "~" "core_session_abstract_add_message"
Apr 16 16:26:16 ubuntu varnishd[31280]: CLI telnet 127.0.0.1 37248 127.0.0.1 6082 Wr 200
我想要的最终结果是简单地说它已成功应用或类似的东西。 注意:我知道密钥与\ n正确放置。而且这里是我尝试安装varnish的链接:https://www.howtoforge.com/tutorial/how-to-setup-magento-2-with-varnish-and-apache-on-ubuntu-1604/我跳过所有关于灯和magento的信息,因为它已经安装并运行,我只运行了清漆部分的命令。提前致谢
如果你想检查Varnish是否在Magento前正确运行你可以运行curl -I localhost
你应该得到一个标题,提到Varnish并提供你后端的内容。