简体   繁体   中英

How to fix 'Failed to apply the VCL to 127.0.0.1:6082: Failed to read response code from Varnish' error in Magento-1.9.4

I'm trying install Varnish-4.1 to magento-1.9, the varnish is working fine alone but when I try to click on btn in Admin->system->Cache management, it shows the error in the title: Failed to apply the VCL to 127.0.0.1:6082: Failed to read response code from Varnish

OS: Ubuntu 18.04
Apache: 2.4.29 (Ubuntu) port: 8080 PHP 7.1.28-1+ubuntu18.04.1
Magento ver. 1.9.4.1
varnish-4.1.11 port 80 from: https://packagecloud.io/varnishcache/varnish41/install#manual-deb

content of /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 status varnish

● 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

My end result that I want is to simply have it say applied successfully or something like that.
Note: I know that the secret key is put correctly with the \\n. and also here is the link from where I tried install varnish: https://www.howtoforge.com/tutorial/how-to-setup-magento-2-with-varnish-and-apache-on-ubuntu-1604/ I skipped all about lamp and magento as it was already installed and running, I only ran the commands of the varnish part. Thanks in advance

如果你想检查Varnish是否在Magento前正确运行你可以运行curl -I localhost你应该得到一个标题,提到Varnish并提供你后端的内容。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM