Commit c1ae9a9e authored by Lasse Karstensen's avatar Lasse Karstensen

Update instructions on port change with systemd.

As suggested by Przemek Sobstel on github.
parent b003cb2f
...@@ -9,10 +9,10 @@ First we stop varnish: ``service varnish stop`` ...@@ -9,10 +9,10 @@ First we stop varnish: ``service varnish stop``
Now we need to edit the configuration file that starts Varnish. Now we need to edit the configuration file that starts Varnish.
Debian/Ubuntu Debian/Ubuntu (legacy)
~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
On Debian/Ubuntu this is `/etc/default/varnish`. In the file you'll find On older Debian/Ubuntu this is `/etc/default/varnish`. In the file you'll find
some text that looks like this:: some text that looks like this::
DAEMON_OPTS="-a :6081 \ DAEMON_OPTS="-a :6081 \
...@@ -29,6 +29,26 @@ Change it to:: ...@@ -29,6 +29,26 @@ Change it to::
-S /etc/varnish/secret \ -S /etc/varnish/secret \
-s malloc,256m" -s malloc,256m"
Debian (v8+) / Ubuntu (v15.04+)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On more recent Debian and Ubuntu systems this is configured in the systemd
service file.
Applying changes to the default service is best done by creating a new file
`/etc/systemd/system/varnish.service.d/customexec.conf`::
[Service]
ExecStart=
ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
This will override the ExecStart part of the default configuration shipped
with Varnish Cache.
Run ``systemctl daemon-reload`` to make sure systemd picks up the new
configuration before restarting Varnish.
Red Hat Enterprise Linux / CentOS Red Hat Enterprise Linux / CentOS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -42,4 +62,3 @@ Restarting Varnish again ...@@ -42,4 +62,3 @@ Restarting Varnish again
Once the change is done, restart Varnish: ``service varnish start``. Once the change is done, restart Varnish: ``service varnish start``.
Now everyone accessing your site will be accessing through Varnish. Now everyone accessing your site will be accessing through Varnish.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment