无法在端口 80 Ubuntu 16.04 上启动 Varnish 缓存

Can't start Varnish cache on port 80 Ubuntu 16.04

帮助我,请与我的 Ubuntu 16.04 apache2 网络服务器交朋友!

安装后 Varnish 缓存 正常启动。但是把它放在80端口之后varnish无法启动:

正在创建 /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 default,256m

然后

systemctl daemon-reload
service varnish start

清漆不启动:

varnish.service - Varnish Cache, a high-performance HTTP accelerator
   Loaded: loaded (/lib/systemd/system/varnish.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/varnish.service.d
           └─customexec.conf
   Active: failed (Result: exit-code) since Thu 2020-07-23 09:41:12 MSK; 21s ago
  Process: 5886 ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s default,256m (code=exited, 
 Main PID: 20786 (code=exited, status=0/SUCCESS)

Jul 23 09:41:12 mj33 systemd[1]: Starting Varnish Cache, a high-performance HTTP accelerator...
Jul 23 09:41:12 mj33 varnishd[5886]: Error: Cannot open -S file (/etc/varnish/secret): No such file or directory
Jul 23 09:41:12 mj33 varnishd[5886]: (-? gives usage)
Jul 23 09:41:12 mj33 systemd[1]: varnish.service: Control process exited, code=exited status=255
Jul 23 09:41:12 mj33 systemd[1]: Failed to start Varnish Cache, a high-performance HTTP accelerator.
Jul 23 09:41:12 mj33 systemd[1]: varnish.service: Unit entered failed state.
Jul 23 09:41:12 mj33 systemd[1]: varnish.service: Failed with result 'exit-code'.

已尝试创建安全文件并编辑 /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

Varnish 第一次启动,但是在 stop/start 之后它没有再次启动:

● varnish.service - Varnish Cache, a high-performance HTTP accelerator
   Loaded: loaded (/lib/systemd/system/varnish.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/varnish.service.d
           └─customexec.conf
   Active: failed (Result: exit-code) since Fri 2020-07-24 10:52:41 MSK; 8s ago
  Process: 9974 ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m (code=exited, status=2
 Main PID: 8395 (code=exited, status=0/SUCCESS)

Jul 24 10:52:40 mj33 systemd[1]: Starting Varnish Cache, a high-performance HTTP accelerator...
Jul 24 10:52:41 mj33 varnishd[9974]: Debug: Version: varnish-6.0.6 revision 29a1a8243dbef3d973aec28dc90403188c1dc8e7
Jul 24 10:52:41 mj33 varnishd[9974]: Debug: Platform: Linux,4.4.0-135-generic,x86_64,-junix,-smalloc,-sdefault,-hcritbit
Jul 24 10:52:41 mj33 varnishd[9974]: Empty secret-file "/etc/varnish/secret"
Jul 24 10:52:41 mj33 varnishd[9976]: Version: varnish-6.0.6 revision 29a1a8243dbef3d973aec28dc90403188c1dc8e7
Jul 24 10:52:41 mj33 varnishd[9976]: Platform: Linux,4.4.0-135-generic,x86_64,-junix,-smalloc,-sdefault,-hcritbit
Jul 24 10:52:41 mj33 systemd[1]: varnish.service: Control process exited, code=exited status=255
Jul 24 10:52:41 mj33 systemd[1]: Failed to start Varnish Cache, a high-performance HTTP accelerator.
Jul 24 10:52:41 mj33 systemd[1]: varnish.service: Unit entered failed state.
Jul 24 10:52:41 mj33 systemd[1]: varnish.service: Failed with result 'exit-code'.

问题是:

Debug: Child (20551) Started
Error: Child (20551) Acceptor start failed:
Listen failed on socket ':80': Address already in use
Debug: Stopping Child
Info: Child (20551) ended