varnish daemon not listening on configured portSystemctl service dependency without changing service fileVarnish VCL not allowing two separate IP addresses as backendsVarnish SMS allocation request generate HTTP 503Varnish does not work on other portApache 2.2 + Varnish not listening to 8080 portVarnish won't start on rebootFailed to find Linux Kernel Module'systemctl restart service' not working on CentOS 7Varnish stoped working and dies after start OKConfiguring MySQL to Listen for Remote Connections on UbuntuI get this error “Active: failed ” from the Process: 9666 ExecStart=/etc/init.d/apache2 start (code=exited, status=2)?

Should developer taking test phones home or put in office?

Using sed to replace "A" with a "B" or "C"

How do I set an alias to a terminal line?

3D Crossword, Cryptic, Statue View & Maze

How do I turn off a repeating trade?

What is the origin of Scooby-Doo's name?

Does Marvel have an equivalent of the Green Lantern?

Unusual mail headers, evidence of an attempted attack. Have I been pwned?

Does squid ink pasta bleed?

Swapping rooks in a 4x4 board

What's currently blocking the construction of the wall between Mexico and the US?

Hand soldering SMD 1206 components

Apply brace expansion in "reverse order"

Has there been any indication at all that further negotiation between the UK and EU is possible?

If the world have massive single giant world tree can it stop earthquake?

Can the negators "jamais, rien, personne, plus, ni, aucun" be used in a single sentence?

What does "play with your toy’s toys" mean?

How to get cool night-vision without lame drawbacks?

How dangerous are set-size assumptions?

Why do textbooks often include the solutions to odd or even numbered problems but not both?

Set multicolumn to a exact width

How much will studying magic in an academy cost?

Vanishing of certain coefficients coming from Coxeter groups

Underbar nabla symbol doesn't work



varnish daemon not listening on configured port


Systemctl service dependency without changing service fileVarnish VCL not allowing two separate IP addresses as backendsVarnish SMS allocation request generate HTTP 503Varnish does not work on other portApache 2.2 + Varnish not listening to 8080 portVarnish won't start on rebootFailed to find Linux Kernel Module'systemctl restart service' not working on CentOS 7Varnish stoped working and dies after start OKConfiguring MySQL to Listen for Remote Connections on UbuntuI get this error “Active: failed ” from the Process: 9666 ExecStart=/etc/init.d/apache2 start (code=exited, status=2)?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








7















I'm trying to install varnish on ubuntu 16.04,



I read several article none are working.
From what I read, since ubuntu 15.04, the way of configuring varnish has changed (because of systemd).



Now on I've got a real mess wich don't work :




/etc/default/varnish :



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



/etc/varnish/default.vcl (normally it points to a host pointing to 127.0.0 and port 8080, but for debuging purpose I modified it to an external domain)
vcl 4.0;



# Default backend definition. Set this to point to your content server.
backend default
.host = "www.varnish-cache.org";
.port = "80";




/etc/apache2/ports.conf



Listen 8080



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



/etc/systemd/system/varnish.service:ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
/etc/systemd/system/varnish.service.d/customexec.conf:ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
/etc/systemd/system/multi-user.target.wants/varnish.service:ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m



/lib/systemd/system/varnish.service :



 GNU nano 2.5.3 Fichier : /lib/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 localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
ExecReload=/usr/share/varnish/reload-vcl
ProtectSystem=full
ProtectHome=true
PrivateTmp=true
PrivateDevices=true

[Install]
WantedBy=multi-user.target



service --status-all | grep varnish



 [ - ] varnish
[ + ] varnishlog
[ + ] varnishncsa



after a



sudo service varnish stop
sudo service varnish start


The varnish service is not listening on http://127.0.0.1:80/, before a reboot, it listend on http://127.0.0.1:6081/ but it don't work no more ... I don't know what to do more...






EDIT : after a reboot, nothing works,



if I do :
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
└─customexec.conf
Active: inactive (dead) since jeu. 2017-01-05 14:48:09 CET; 1s ago
Docs: https://www.varnish-cache.org/docs/4.1/
man:varnishd
Process: 5077 ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m (code=exited, status=0/SUCCESS)
Main PID: 5077 (code=exited, status=0/SUCCESS)

janv. 05 14:48:09 xubuntu-16 systemd[1]: Started Varnish HTTP accelerator.



service --status-all | grep varnish



 [ - ] varnish
[ - ] varnishlog
[ - ] varnishncsa



if I sudo : varnishd -d -f /etc/varnish/default.vcl, then start, everything works fine... until i quit the cli




solved thanks to @Gerald Schneider response. I post the steps I had to do :



sudo apt remove varnish
sudo apt-get purge varnish
# I manually remove the 3 files in created in /etc/systemd/system/*
sudo apt install varnish
sudo nano /lib/systemd/system/varnish.service # put the rigth conf
sudo nano /etc/varnish/default.vcl #put the rigth conf
sudo systemctl daemon-reload
sudo service varnish restart


and everything works fine!
the magic is in the /lib/systemd/system/varnish.service file, other online resources that I found made me make think it is elsewhere, so beware of the online (outdated) tutorials!










share|improve this question
























  • Probably needed to just remove your previous drop in -> . /etc/systemd/system/varnish.service

    – Mike Q
    Dec 17 '18 at 20:10

















7















I'm trying to install varnish on ubuntu 16.04,



I read several article none are working.
From what I read, since ubuntu 15.04, the way of configuring varnish has changed (because of systemd).



Now on I've got a real mess wich don't work :




/etc/default/varnish :



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



/etc/varnish/default.vcl (normally it points to a host pointing to 127.0.0 and port 8080, but for debuging purpose I modified it to an external domain)
vcl 4.0;



# Default backend definition. Set this to point to your content server.
backend default
.host = "www.varnish-cache.org";
.port = "80";




/etc/apache2/ports.conf



Listen 8080



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



/etc/systemd/system/varnish.service:ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
/etc/systemd/system/varnish.service.d/customexec.conf:ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
/etc/systemd/system/multi-user.target.wants/varnish.service:ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m



/lib/systemd/system/varnish.service :



 GNU nano 2.5.3 Fichier : /lib/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 localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
ExecReload=/usr/share/varnish/reload-vcl
ProtectSystem=full
ProtectHome=true
PrivateTmp=true
PrivateDevices=true

[Install]
WantedBy=multi-user.target



service --status-all | grep varnish



 [ - ] varnish
[ + ] varnishlog
[ + ] varnishncsa



after a



sudo service varnish stop
sudo service varnish start


The varnish service is not listening on http://127.0.0.1:80/, before a reboot, it listend on http://127.0.0.1:6081/ but it don't work no more ... I don't know what to do more...






EDIT : after a reboot, nothing works,



if I do :
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
└─customexec.conf
Active: inactive (dead) since jeu. 2017-01-05 14:48:09 CET; 1s ago
Docs: https://www.varnish-cache.org/docs/4.1/
man:varnishd
Process: 5077 ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m (code=exited, status=0/SUCCESS)
Main PID: 5077 (code=exited, status=0/SUCCESS)

janv. 05 14:48:09 xubuntu-16 systemd[1]: Started Varnish HTTP accelerator.



service --status-all | grep varnish



 [ - ] varnish
[ - ] varnishlog
[ - ] varnishncsa



if I sudo : varnishd -d -f /etc/varnish/default.vcl, then start, everything works fine... until i quit the cli




solved thanks to @Gerald Schneider response. I post the steps I had to do :



sudo apt remove varnish
sudo apt-get purge varnish
# I manually remove the 3 files in created in /etc/systemd/system/*
sudo apt install varnish
sudo nano /lib/systemd/system/varnish.service # put the rigth conf
sudo nano /etc/varnish/default.vcl #put the rigth conf
sudo systemctl daemon-reload
sudo service varnish restart


and everything works fine!
the magic is in the /lib/systemd/system/varnish.service file, other online resources that I found made me make think it is elsewhere, so beware of the online (outdated) tutorials!










share|improve this question
























  • Probably needed to just remove your previous drop in -> . /etc/systemd/system/varnish.service

    – Mike Q
    Dec 17 '18 at 20:10













7












7








7


1






I'm trying to install varnish on ubuntu 16.04,



I read several article none are working.
From what I read, since ubuntu 15.04, the way of configuring varnish has changed (because of systemd).



Now on I've got a real mess wich don't work :




/etc/default/varnish :



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



/etc/varnish/default.vcl (normally it points to a host pointing to 127.0.0 and port 8080, but for debuging purpose I modified it to an external domain)
vcl 4.0;



# Default backend definition. Set this to point to your content server.
backend default
.host = "www.varnish-cache.org";
.port = "80";




/etc/apache2/ports.conf



Listen 8080



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



/etc/systemd/system/varnish.service:ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
/etc/systemd/system/varnish.service.d/customexec.conf:ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
/etc/systemd/system/multi-user.target.wants/varnish.service:ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m



/lib/systemd/system/varnish.service :



 GNU nano 2.5.3 Fichier : /lib/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 localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
ExecReload=/usr/share/varnish/reload-vcl
ProtectSystem=full
ProtectHome=true
PrivateTmp=true
PrivateDevices=true

[Install]
WantedBy=multi-user.target



service --status-all | grep varnish



 [ - ] varnish
[ + ] varnishlog
[ + ] varnishncsa



after a



sudo service varnish stop
sudo service varnish start


The varnish service is not listening on http://127.0.0.1:80/, before a reboot, it listend on http://127.0.0.1:6081/ but it don't work no more ... I don't know what to do more...






EDIT : after a reboot, nothing works,



if I do :
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
└─customexec.conf
Active: inactive (dead) since jeu. 2017-01-05 14:48:09 CET; 1s ago
Docs: https://www.varnish-cache.org/docs/4.1/
man:varnishd
Process: 5077 ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m (code=exited, status=0/SUCCESS)
Main PID: 5077 (code=exited, status=0/SUCCESS)

janv. 05 14:48:09 xubuntu-16 systemd[1]: Started Varnish HTTP accelerator.



service --status-all | grep varnish



 [ - ] varnish
[ - ] varnishlog
[ - ] varnishncsa



if I sudo : varnishd -d -f /etc/varnish/default.vcl, then start, everything works fine... until i quit the cli




solved thanks to @Gerald Schneider response. I post the steps I had to do :



sudo apt remove varnish
sudo apt-get purge varnish
# I manually remove the 3 files in created in /etc/systemd/system/*
sudo apt install varnish
sudo nano /lib/systemd/system/varnish.service # put the rigth conf
sudo nano /etc/varnish/default.vcl #put the rigth conf
sudo systemctl daemon-reload
sudo service varnish restart


and everything works fine!
the magic is in the /lib/systemd/system/varnish.service file, other online resources that I found made me make think it is elsewhere, so beware of the online (outdated) tutorials!










share|improve this question
















I'm trying to install varnish on ubuntu 16.04,



I read several article none are working.
From what I read, since ubuntu 15.04, the way of configuring varnish has changed (because of systemd).



Now on I've got a real mess wich don't work :




/etc/default/varnish :



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



/etc/varnish/default.vcl (normally it points to a host pointing to 127.0.0 and port 8080, but for debuging purpose I modified it to an external domain)
vcl 4.0;



# Default backend definition. Set this to point to your content server.
backend default
.host = "www.varnish-cache.org";
.port = "80";




/etc/apache2/ports.conf



Listen 8080



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



/etc/systemd/system/varnish.service:ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
/etc/systemd/system/varnish.service.d/customexec.conf:ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
/etc/systemd/system/multi-user.target.wants/varnish.service:ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m



/lib/systemd/system/varnish.service :



 GNU nano 2.5.3 Fichier : /lib/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 localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
ExecReload=/usr/share/varnish/reload-vcl
ProtectSystem=full
ProtectHome=true
PrivateTmp=true
PrivateDevices=true

[Install]
WantedBy=multi-user.target



service --status-all | grep varnish



 [ - ] varnish
[ + ] varnishlog
[ + ] varnishncsa



after a



sudo service varnish stop
sudo service varnish start


The varnish service is not listening on http://127.0.0.1:80/, before a reboot, it listend on http://127.0.0.1:6081/ but it don't work no more ... I don't know what to do more...






EDIT : after a reboot, nothing works,



if I do :
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
└─customexec.conf
Active: inactive (dead) since jeu. 2017-01-05 14:48:09 CET; 1s ago
Docs: https://www.varnish-cache.org/docs/4.1/
man:varnishd
Process: 5077 ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m (code=exited, status=0/SUCCESS)
Main PID: 5077 (code=exited, status=0/SUCCESS)

janv. 05 14:48:09 xubuntu-16 systemd[1]: Started Varnish HTTP accelerator.



service --status-all | grep varnish



 [ - ] varnish
[ - ] varnishlog
[ - ] varnishncsa



if I sudo : varnishd -d -f /etc/varnish/default.vcl, then start, everything works fine... until i quit the cli




solved thanks to @Gerald Schneider response. I post the steps I had to do :



sudo apt remove varnish
sudo apt-get purge varnish
# I manually remove the 3 files in created in /etc/systemd/system/*
sudo apt install varnish
sudo nano /lib/systemd/system/varnish.service # put the rigth conf
sudo nano /etc/varnish/default.vcl #put the rigth conf
sudo systemctl daemon-reload
sudo service varnish restart


and everything works fine!
the magic is in the /lib/systemd/system/varnish.service file, other online resources that I found made me make think it is elsewhere, so beware of the online (outdated) tutorials!







ubuntu varnish service systemd ubuntu-16.04






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 19 '17 at 12:41







Bruno

















asked Jan 5 '17 at 13:22









BrunoBruno

1381 silver badge6 bronze badges




1381 silver badge6 bronze badges












  • Probably needed to just remove your previous drop in -> . /etc/systemd/system/varnish.service

    – Mike Q
    Dec 17 '18 at 20:10

















  • Probably needed to just remove your previous drop in -> . /etc/systemd/system/varnish.service

    – Mike Q
    Dec 17 '18 at 20:10
















Probably needed to just remove your previous drop in -> . /etc/systemd/system/varnish.service

– Mike Q
Dec 17 '18 at 20:10





Probably needed to just remove your previous drop in -> . /etc/systemd/system/varnish.service

– Mike Q
Dec 17 '18 at 20:10










2 Answers
2






active

oldest

votes


















12














You need to change the varnish start parameters in the systemd service definition as well. You could edit the line starting with ExecStart in the service defintion file:



sudo vi /lib/systemd/system/varnish.service


Modifying this file however, has the disadvantage that it will not be updated in future updates of the package. Alternatively, as suggested in the comments, you could create a systemd drop in file, which is the preferred way of adding settings to systemd definitions.



# create the drop in directory
sudo mkdir /etc/systemd/system/varnish.service.d
# create the drop in file. The name is irrelevant, as long as it ends in .conf
sudo vi /etc/systemd/system/varnish.service.d/mysettings.conf


Here you only need to add the settings you want do change, everything else will be loaded from the default definition file.



Example:



[Service]
ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m


This is the default line, change it as you need



Afterwards, tell systemctl to reload it's config files and to restart the service



sudo systemctl daemon-reload
sudo service varnish restart


Varnish should now listen on port 80.






share|improve this answer

























  • I've done this, this file contain : [...] [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 localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m ExecReload=/usr/share/varnish/reload-vcl [...]

    – Bruno
    Jan 5 '17 at 13:56












  • Maybe you should restore the default configuration files for apache and varnish and start over. I've set this up to test it and I only had to change the apache config to listen on port 8080 and the single line in varnish.service. Nothing else.

    – Gerald Schneider
    Jan 5 '17 at 14:00











  • thanks, it worked! I add the steps to uninstall in my post

    – Bruno
    Jan 5 '17 at 14:09











  • This is the wrong approach. Systemd unit files in /lib/systemd should not be edited, they should be overridden with drop-in files in /etc/systemd

    – Stephen
    Apr 15 '17 at 12:24






  • 1





    systemctl edit varnish.service automates creating unit file override drop-ins for you

    – HBruijn
    Dec 11 '18 at 9:17


















2














Note that the drop-in should have an empty ExecStart=
Otherwise you will get an error starting the service (duplicate ExecStart)



sudo mkdir /etc/systemd/system/varnish.service.d
sudo nano /etc/systemd/system/varnish.service.d/varnishd.conf


With



[Service]
ExecStart=
ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T <YOUR WEBSERVER IP>:8081 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m





share|improve this answer



























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "2"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f824389%2fvarnish-daemon-not-listening-on-configured-port%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    12














    You need to change the varnish start parameters in the systemd service definition as well. You could edit the line starting with ExecStart in the service defintion file:



    sudo vi /lib/systemd/system/varnish.service


    Modifying this file however, has the disadvantage that it will not be updated in future updates of the package. Alternatively, as suggested in the comments, you could create a systemd drop in file, which is the preferred way of adding settings to systemd definitions.



    # create the drop in directory
    sudo mkdir /etc/systemd/system/varnish.service.d
    # create the drop in file. The name is irrelevant, as long as it ends in .conf
    sudo vi /etc/systemd/system/varnish.service.d/mysettings.conf


    Here you only need to add the settings you want do change, everything else will be loaded from the default definition file.



    Example:



    [Service]
    ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m


    This is the default line, change it as you need



    Afterwards, tell systemctl to reload it's config files and to restart the service



    sudo systemctl daemon-reload
    sudo service varnish restart


    Varnish should now listen on port 80.






    share|improve this answer

























    • I've done this, this file contain : [...] [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 localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m ExecReload=/usr/share/varnish/reload-vcl [...]

      – Bruno
      Jan 5 '17 at 13:56












    • Maybe you should restore the default configuration files for apache and varnish and start over. I've set this up to test it and I only had to change the apache config to listen on port 8080 and the single line in varnish.service. Nothing else.

      – Gerald Schneider
      Jan 5 '17 at 14:00











    • thanks, it worked! I add the steps to uninstall in my post

      – Bruno
      Jan 5 '17 at 14:09











    • This is the wrong approach. Systemd unit files in /lib/systemd should not be edited, they should be overridden with drop-in files in /etc/systemd

      – Stephen
      Apr 15 '17 at 12:24






    • 1





      systemctl edit varnish.service automates creating unit file override drop-ins for you

      – HBruijn
      Dec 11 '18 at 9:17















    12














    You need to change the varnish start parameters in the systemd service definition as well. You could edit the line starting with ExecStart in the service defintion file:



    sudo vi /lib/systemd/system/varnish.service


    Modifying this file however, has the disadvantage that it will not be updated in future updates of the package. Alternatively, as suggested in the comments, you could create a systemd drop in file, which is the preferred way of adding settings to systemd definitions.



    # create the drop in directory
    sudo mkdir /etc/systemd/system/varnish.service.d
    # create the drop in file. The name is irrelevant, as long as it ends in .conf
    sudo vi /etc/systemd/system/varnish.service.d/mysettings.conf


    Here you only need to add the settings you want do change, everything else will be loaded from the default definition file.



    Example:



    [Service]
    ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m


    This is the default line, change it as you need



    Afterwards, tell systemctl to reload it's config files and to restart the service



    sudo systemctl daemon-reload
    sudo service varnish restart


    Varnish should now listen on port 80.






    share|improve this answer

























    • I've done this, this file contain : [...] [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 localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m ExecReload=/usr/share/varnish/reload-vcl [...]

      – Bruno
      Jan 5 '17 at 13:56












    • Maybe you should restore the default configuration files for apache and varnish and start over. I've set this up to test it and I only had to change the apache config to listen on port 8080 and the single line in varnish.service. Nothing else.

      – Gerald Schneider
      Jan 5 '17 at 14:00











    • thanks, it worked! I add the steps to uninstall in my post

      – Bruno
      Jan 5 '17 at 14:09











    • This is the wrong approach. Systemd unit files in /lib/systemd should not be edited, they should be overridden with drop-in files in /etc/systemd

      – Stephen
      Apr 15 '17 at 12:24






    • 1





      systemctl edit varnish.service automates creating unit file override drop-ins for you

      – HBruijn
      Dec 11 '18 at 9:17













    12












    12








    12







    You need to change the varnish start parameters in the systemd service definition as well. You could edit the line starting with ExecStart in the service defintion file:



    sudo vi /lib/systemd/system/varnish.service


    Modifying this file however, has the disadvantage that it will not be updated in future updates of the package. Alternatively, as suggested in the comments, you could create a systemd drop in file, which is the preferred way of adding settings to systemd definitions.



    # create the drop in directory
    sudo mkdir /etc/systemd/system/varnish.service.d
    # create the drop in file. The name is irrelevant, as long as it ends in .conf
    sudo vi /etc/systemd/system/varnish.service.d/mysettings.conf


    Here you only need to add the settings you want do change, everything else will be loaded from the default definition file.



    Example:



    [Service]
    ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m


    This is the default line, change it as you need



    Afterwards, tell systemctl to reload it's config files and to restart the service



    sudo systemctl daemon-reload
    sudo service varnish restart


    Varnish should now listen on port 80.






    share|improve this answer















    You need to change the varnish start parameters in the systemd service definition as well. You could edit the line starting with ExecStart in the service defintion file:



    sudo vi /lib/systemd/system/varnish.service


    Modifying this file however, has the disadvantage that it will not be updated in future updates of the package. Alternatively, as suggested in the comments, you could create a systemd drop in file, which is the preferred way of adding settings to systemd definitions.



    # create the drop in directory
    sudo mkdir /etc/systemd/system/varnish.service.d
    # create the drop in file. The name is irrelevant, as long as it ends in .conf
    sudo vi /etc/systemd/system/varnish.service.d/mysettings.conf


    Here you only need to add the settings you want do change, everything else will be loaded from the default definition file.



    Example:



    [Service]
    ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m


    This is the default line, change it as you need



    Afterwards, tell systemctl to reload it's config files and to restart the service



    sudo systemctl daemon-reload
    sudo service varnish restart


    Varnish should now listen on port 80.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Apr 26 '18 at 9:07

























    answered Jan 5 '17 at 13:55









    Gerald SchneiderGerald Schneider

    7,3383 gold badges27 silver badges48 bronze badges




    7,3383 gold badges27 silver badges48 bronze badges












    • I've done this, this file contain : [...] [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 localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m ExecReload=/usr/share/varnish/reload-vcl [...]

      – Bruno
      Jan 5 '17 at 13:56












    • Maybe you should restore the default configuration files for apache and varnish and start over. I've set this up to test it and I only had to change the apache config to listen on port 8080 and the single line in varnish.service. Nothing else.

      – Gerald Schneider
      Jan 5 '17 at 14:00











    • thanks, it worked! I add the steps to uninstall in my post

      – Bruno
      Jan 5 '17 at 14:09











    • This is the wrong approach. Systemd unit files in /lib/systemd should not be edited, they should be overridden with drop-in files in /etc/systemd

      – Stephen
      Apr 15 '17 at 12:24






    • 1





      systemctl edit varnish.service automates creating unit file override drop-ins for you

      – HBruijn
      Dec 11 '18 at 9:17

















    • I've done this, this file contain : [...] [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 localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m ExecReload=/usr/share/varnish/reload-vcl [...]

      – Bruno
      Jan 5 '17 at 13:56












    • Maybe you should restore the default configuration files for apache and varnish and start over. I've set this up to test it and I only had to change the apache config to listen on port 8080 and the single line in varnish.service. Nothing else.

      – Gerald Schneider
      Jan 5 '17 at 14:00











    • thanks, it worked! I add the steps to uninstall in my post

      – Bruno
      Jan 5 '17 at 14:09











    • This is the wrong approach. Systemd unit files in /lib/systemd should not be edited, they should be overridden with drop-in files in /etc/systemd

      – Stephen
      Apr 15 '17 at 12:24






    • 1





      systemctl edit varnish.service automates creating unit file override drop-ins for you

      – HBruijn
      Dec 11 '18 at 9:17
















    I've done this, this file contain : [...] [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 localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m ExecReload=/usr/share/varnish/reload-vcl [...]

    – Bruno
    Jan 5 '17 at 13:56






    I've done this, this file contain : [...] [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 localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m ExecReload=/usr/share/varnish/reload-vcl [...]

    – Bruno
    Jan 5 '17 at 13:56














    Maybe you should restore the default configuration files for apache and varnish and start over. I've set this up to test it and I only had to change the apache config to listen on port 8080 and the single line in varnish.service. Nothing else.

    – Gerald Schneider
    Jan 5 '17 at 14:00





    Maybe you should restore the default configuration files for apache and varnish and start over. I've set this up to test it and I only had to change the apache config to listen on port 8080 and the single line in varnish.service. Nothing else.

    – Gerald Schneider
    Jan 5 '17 at 14:00













    thanks, it worked! I add the steps to uninstall in my post

    – Bruno
    Jan 5 '17 at 14:09





    thanks, it worked! I add the steps to uninstall in my post

    – Bruno
    Jan 5 '17 at 14:09













    This is the wrong approach. Systemd unit files in /lib/systemd should not be edited, they should be overridden with drop-in files in /etc/systemd

    – Stephen
    Apr 15 '17 at 12:24





    This is the wrong approach. Systemd unit files in /lib/systemd should not be edited, they should be overridden with drop-in files in /etc/systemd

    – Stephen
    Apr 15 '17 at 12:24




    1




    1





    systemctl edit varnish.service automates creating unit file override drop-ins for you

    – HBruijn
    Dec 11 '18 at 9:17





    systemctl edit varnish.service automates creating unit file override drop-ins for you

    – HBruijn
    Dec 11 '18 at 9:17













    2














    Note that the drop-in should have an empty ExecStart=
    Otherwise you will get an error starting the service (duplicate ExecStart)



    sudo mkdir /etc/systemd/system/varnish.service.d
    sudo nano /etc/systemd/system/varnish.service.d/varnishd.conf


    With



    [Service]
    ExecStart=
    ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T <YOUR WEBSERVER IP>:8081 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m





    share|improve this answer





























      2














      Note that the drop-in should have an empty ExecStart=
      Otherwise you will get an error starting the service (duplicate ExecStart)



      sudo mkdir /etc/systemd/system/varnish.service.d
      sudo nano /etc/systemd/system/varnish.service.d/varnishd.conf


      With



      [Service]
      ExecStart=
      ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T <YOUR WEBSERVER IP>:8081 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m





      share|improve this answer



























        2












        2








        2







        Note that the drop-in should have an empty ExecStart=
        Otherwise you will get an error starting the service (duplicate ExecStart)



        sudo mkdir /etc/systemd/system/varnish.service.d
        sudo nano /etc/systemd/system/varnish.service.d/varnishd.conf


        With



        [Service]
        ExecStart=
        ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T <YOUR WEBSERVER IP>:8081 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m





        share|improve this answer















        Note that the drop-in should have an empty ExecStart=
        Otherwise you will get an error starting the service (duplicate ExecStart)



        sudo mkdir /etc/systemd/system/varnish.service.d
        sudo nano /etc/systemd/system/varnish.service.d/varnishd.conf


        With



        [Service]
        ExecStart=
        ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T <YOUR WEBSERVER IP>:8081 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jun 6 at 20:55









        guaka

        3564 silver badges22 bronze badges




        3564 silver badges22 bronze badges










        answered Apr 30 '18 at 23:54









        GeorgeGeorge

        1212 bronze badges




        1212 bronze badges



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Server Fault!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f824389%2fvarnish-daemon-not-listening-on-configured-port%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

            Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

            Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020