Как исправить ошибку «Не удалось применить VCL к 127.0.0.1:6082: Ошибка чтения кода ответа из Varnish» в Magento-1.9.4 - PullRequest
0 голосов
/ 16 апреля 2019

Я пытаюсь установить Varnish-4.1 в magento-1.9, лак работает в одиночку, но когда я пытаюсь нажать btn в Admin-> system-> Cache management, в заголовке отображается ошибка: Failed toприменить 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.а также вот ссылка, откуда я пытался установить лак: https://www.howtoforge.com/tutorial/how-to-setup-magento-2-with-varnish-and-apache-on-ubuntu-1604/ Я пропустил все, что касается лампы и magento, так как он уже был установлен и запущен, я только запускал команды части лака.Заранее спасибо

1 Ответ

0 голосов
/ 17 апреля 2019

Если вы хотите проверить, правильно ли работает Varnish перед Magento, вы можете запустить curl -I localhost, вы должны получить заголовок, в котором упоминается Varnish и который обслуживает содержимое из вашего бэкенда.

...