Debian8中修改Varnish默认端口为80

Varnish 的默认端口是 6081,而不是 80 端口。所以还得改改,

一、修改 /lib/systemd/system/varnish.service文件

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

二、修改 /etc/default/varnish 文件

DAEMON_OPTS="-a :6081 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,256m -t 120"
将两个文件的 -a :6081 \ ,改为 -a :80 \ 就可以监听 80 端口了,当然,前提是没有东西占用你的 80 端口。

然后重启 varnish。

systemctl daemon-reload
service varnish restart

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注