How to install varnish on port 80. DAEMON_OPTS malfunction installed in / etc / default / lnish

I installed the varnish and set the exact instructions for setting it, however it does not work properly.

My setup is / etc / default / ln:

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

My setup is /etc/varnish/default.vlc

 backend default { .host = "localhost"; .port = "8080"; } 

My apache port.conf setup is:

 NameVirtualHost 127.0.0.1:8080 Listen 127.0.0.1:8080 <IfModule ssl_module> Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule> 

I am running ubuntu 15.04 with Apache 2.4.10. When I start the varnish and test the process, I get the following:

 0:00 /usr/sbin/varnishd -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m 

It appears that neither the Listen address nor the Management interface, as set in /etc/varnish/default.vcl. As a result, none of my virtual machines work. How can i solve this?

+8
systemd varnish varnish-vcl
source share
1 answer

Ok The problem is solved. First do

 sudo grep -R 'ExecStart=/usr/sbin/varnishd' /etc/ 

so that you can find another place where the daemon settings for Varnish are set (in my case it was / etc / systemd / system / multi -user.target.wants / varnish.service). Open the file in vim, nano or something else and set "ExecStart" in this file as vapor:

 -a :[same as /etc/default/varnish]80 -T localhost:[same as /etc/default/varnish]1234 -f [same as /etc/default/varnish ]/etc/varnish/default.vcl -S [same as /etc/default/varnish ]/etc/varnish/secret -s malloc,256m 

Save and exit. After that do:

 systemctl daemon-reload systemctl restart varnish.service 

And then we are done. Nothing like an official textbook. Apparently he is old.

Full explanation of the problem here

+26
source share

All Articles