I've had varnish running on my site for awhile now configured to listen on port 80 and apache on port 8080. This morning I noticed that varnish is now listening on port 6081. When I systemctl restart varnish
it still is listening on port 6081.
ps aux | grep varnish
vcache 1010 0.0 0.0 18524 11620 ? SLs 14:39 0:00 /usr/sbin/varnishd -j unix,user=vcache -F -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
vcache 1023 0.0 0.0 286156 68660 ? SLl 14:39 0:00 /usr/sbin/varnishd -j unix,user=vcache -F -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
root 2248 0.0 0.0 3084 896 pts/0 S+ 14:53 0:00 grep varnish
varnish+ 4593 0.1 0.0 86596 1144 ? Ss 06:57 0:32 /usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log -D -P /run/varnishncsa/varnishncsa.pid
/etc/default/varnish
DAEMON_OPTS="-a :80 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,48G"
How can I get varnish to listen on the configured port and also find out why this happened?
Update
This answer solved the issue. I had to modify /etc/systemd/system/multi-user.target.wants/varnish.service
. But now my question is why? Not exactly sure what this file is or why it had port 6081 in it.