无法在端口 80 CentOS v7.9.2009 kvm [ns] 上启动 Varnish - 错误:-a 参数 localhost:8443 和 localhost:8443 具有相同的地址
请你们帮忙。我之前安装了 Varnish &工作如下: https://computingforgeeks.com/install- varnish-cache-for-apache-nginx-on-centos/。最近已经不行了。不知道为什么。
[root@ns ~]# systemctl status varnish.service
● varnish.service - Varnish Cache, a high-performance HTTP accelerator
Loaded: loaded (/usr/lib/systemd/system/varnish.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-03-02 08:41:43 UTC; 10s ago
Process: 22134 ExecStart=/usr/sbin/varnishd -a :80 -a localhost:8443,PROXY -p feature=+http2 -f /etc/varnish/default.vcl -s malloc,256m (code=exited, status=255)
Mar 02 08:41:42 [nameserver url] systemd[1]: Starting Varnish Cache, a high-performance HTTP accelerator...
Mar 02 08:41:42 [nameserver url] varnishd[22134]: Error: -a arguments localhost:8443 and localhost:8443 have same address
Mar 02 08:41:42 [nameserver url] varnishd[22134]: (-? gives usage)
Mar 02 08:41:43 [nameserver url] systemd[1]: varnish.service: control process exited, code=exited status=255
Mar 02 08:41:43 [nameserver url] systemd[1]: Failed to start Varnish Cache, a high-performance HTTP accelerator.
Mar 02 08:41:43 [nameserver url] systemd[1]: Unit varnish.service entered failed state.
Mar 02 08:41:43 [nameserver url] systemd[1]: varnish.service failed.
我猜问题是:
Mar 02 08:41:42 [nameserver url] varnishd[22134]: Error: -a arguments localhost:8443 and localhost:8443 have same address
运行 netstat -ltnp 来检查端口:8443
[root@ns ~]# netstat -ltnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:2095 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 1866/perl
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 612/rpcbind
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 21294/httpd
tcp 0 0 0.0.0.0:2096 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 822/exim
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1720/pdns_server
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 1444/pure-ftpd (SER
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1750/sshd
tcp 0 0 0.0.0.0:8088 0.0.0.0:* LISTEN 9669/openlitespeed
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1720/pdns_server
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 822/exim
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 21294/httpd
tcp 0 0 0.0.0.0:2077 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:2078 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 127.0.0.1:446 0.0.0.0:* LISTEN 1488/docstore
tcp 0 0 0.0.0.0:52223 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2079 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:52224 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2080 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:2082 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:52227 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2083 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:52228 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:52229 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:52230 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2086 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:52231 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2087 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:7080 0.0.0.0:* LISTEN 9669/openlitespeed
tcp 0 0 0.0.0.0:52232 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2090 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:2091 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 1718/redis-server 1
tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 1443/memcached
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 822/exim
tcp6 0 0 :::110 :::* LISTEN 1461/dovecot
tcp6 0 0 ::1:783 :::* LISTEN 1866/perl
tcp6 0 0 :::143 :::* LISTEN 1461/dovecot
tcp6 0 0 :::111 :::* LISTEN 612/rpcbind
tcp6 0 0 :::8080 :::* LISTEN 21294/httpd
tcp6 0 0 :::465 :::* LISTEN 822/exim
tcp6 0 0 :::53 :::* LISTEN 1720/pdns_server
tcp6 0 0 :::21 :::* LISTEN 1444/pure-ftpd (SER
tcp6 0 0 :::4949 :::* LISTEN 847/perl
tcp6 0 0 :::22 :::* LISTEN 1750/sshd
tcp6 0 0 :::25 :::* LISTEN 822/exim
tcp6 0 0 :::443 :::* LISTEN 21294/httpd
tcp6 0 0 :::52223 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52224 :::* LISTEN 2190/im360: master
tcp6 0 0 :::993 :::* LISTEN 1461/dovecot
tcp6 0 0 :::52227 :::* LISTEN 2190/im360: master
tcp6 0 0 :::995 :::* LISTEN 1461/dovecot
tcp6 0 0 :::52228 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52229 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52230 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52231 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52232 :::* LISTEN 2190/im360: master
tcp6 0 0 :::3306 :::* LISTEN 2008/mysqld
tcp6 0 0 :::11211 :::* LISTEN 1443/memcached
tcp6 0 0 :::587 :::* LISTEN 822/exim
但我发现没有这样的端口。尝试重新启动 Apache、服务器和清漆。没有帮助。大家有遇到过类似的问题吗?我该如何解决这个问题?先感谢您
Would you guys please help. I installed Varnish before & worked following: https://computingforgeeks.com/install-varnish-cache-for-apache-nginx-on-centos/. It recently doesn't work anymore. Have no idea why.
[root@ns ~]# systemctl status varnish.service
● varnish.service - Varnish Cache, a high-performance HTTP accelerator
Loaded: loaded (/usr/lib/systemd/system/varnish.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-03-02 08:41:43 UTC; 10s ago
Process: 22134 ExecStart=/usr/sbin/varnishd -a :80 -a localhost:8443,PROXY -p feature=+http2 -f /etc/varnish/default.vcl -s malloc,256m (code=exited, status=255)
Mar 02 08:41:42 [nameserver url] systemd[1]: Starting Varnish Cache, a high-performance HTTP accelerator...
Mar 02 08:41:42 [nameserver url] varnishd[22134]: Error: -a arguments localhost:8443 and localhost:8443 have same address
Mar 02 08:41:42 [nameserver url] varnishd[22134]: (-? gives usage)
Mar 02 08:41:43 [nameserver url] systemd[1]: varnish.service: control process exited, code=exited status=255
Mar 02 08:41:43 [nameserver url] systemd[1]: Failed to start Varnish Cache, a high-performance HTTP accelerator.
Mar 02 08:41:43 [nameserver url] systemd[1]: Unit varnish.service entered failed state.
Mar 02 08:41:43 [nameserver url] systemd[1]: varnish.service failed.
I guess the issue is:
Mar 02 08:41:42 [nameserver url] varnishd[22134]: Error: -a arguments localhost:8443 and localhost:8443 have same address
Ran netstat -ltnp to check ports :8443
[root@ns ~]# netstat -ltnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:2095 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 1866/perl
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 612/rpcbind
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 21294/httpd
tcp 0 0 0.0.0.0:2096 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 822/exim
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1720/pdns_server
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 1444/pure-ftpd (SER
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1750/sshd
tcp 0 0 0.0.0.0:8088 0.0.0.0:* LISTEN 9669/openlitespeed
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1720/pdns_server
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 822/exim
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 21294/httpd
tcp 0 0 0.0.0.0:2077 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:2078 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 127.0.0.1:446 0.0.0.0:* LISTEN 1488/docstore
tcp 0 0 0.0.0.0:52223 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2079 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:52224 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2080 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:2082 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:52227 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2083 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 1461/dovecot
tcp 0 0 0.0.0.0:52228 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:52229 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:52230 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2086 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:52231 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2087 0.0.0.0:* LISTEN 1741/cpsrvd (SSL) -
tcp 0 0 0.0.0.0:7080 0.0.0.0:* LISTEN 9669/openlitespeed
tcp 0 0 0.0.0.0:52232 0.0.0.0:* LISTEN 2190/im360: master
tcp 0 0 0.0.0.0:2090 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 0.0.0.0:2091 0.0.0.0:* LISTEN 2029/cpdavd - accep
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 1718/redis-server 1
tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 1443/memcached
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 822/exim
tcp6 0 0 :::110 :::* LISTEN 1461/dovecot
tcp6 0 0 ::1:783 :::* LISTEN 1866/perl
tcp6 0 0 :::143 :::* LISTEN 1461/dovecot
tcp6 0 0 :::111 :::* LISTEN 612/rpcbind
tcp6 0 0 :::8080 :::* LISTEN 21294/httpd
tcp6 0 0 :::465 :::* LISTEN 822/exim
tcp6 0 0 :::53 :::* LISTEN 1720/pdns_server
tcp6 0 0 :::21 :::* LISTEN 1444/pure-ftpd (SER
tcp6 0 0 :::4949 :::* LISTEN 847/perl
tcp6 0 0 :::22 :::* LISTEN 1750/sshd
tcp6 0 0 :::25 :::* LISTEN 822/exim
tcp6 0 0 :::443 :::* LISTEN 21294/httpd
tcp6 0 0 :::52223 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52224 :::* LISTEN 2190/im360: master
tcp6 0 0 :::993 :::* LISTEN 1461/dovecot
tcp6 0 0 :::52227 :::* LISTEN 2190/im360: master
tcp6 0 0 :::995 :::* LISTEN 1461/dovecot
tcp6 0 0 :::52228 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52229 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52230 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52231 :::* LISTEN 2190/im360: master
tcp6 0 0 :::52232 :::* LISTEN 2190/im360: master
tcp6 0 0 :::3306 :::* LISTEN 2008/mysqld
tcp6 0 0 :::11211 :::* LISTEN 1443/memcached
tcp6 0 0 :::587 :::* LISTEN 822/exim
But I found no such port. Tried to restart Apache, and server and varnish. No help. Have you guys met the similar issue? How can I fix this? Thank you in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用以下命令运行默认的清漆服务配置文件:
我认为问题在于这个。移除后清漆再次发挥作用。但我不确定它是否会在其他地方造成麻烦。
I run the default varnish service config file using:
I think the issue is this one. Remove and Varnish works again. But I am not sure if it cause trouble somewhere else.