centos - 无法在端口 80 CentOS v7.9.2009 kvm [ns] 上启动 Varnish - 错误 : -a arguments localhost:8443 and localhost:8443 have same address

标签 centos varnish

请各位帮忙。我之前安装了 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、服务器和 Varnish 。没有帮助。大家有遇到过类似的问题吗?我怎样才能解决这个问题?先感谢您

最佳答案

我使用以下命令运行默认 Varnish 服务配置文件:

$ sudo vi /etc/systemd/system/multi-user.target.wants/varnish.service

ExecStart=/usr/sbin/varnishd \
                  -a :80 \
                  -a localhost:8443,PROXY \
                  -p feature=+http2 \
                  -f /etc/varnish/default.vcl \
                  -s malloc,256m
        ExecReload=/usr/sbin/varnishreload
我认为问题是这个。删除和 Varnish 再次工作。但我不确定它是否会在其他地方造成麻烦。
              -a localhost:8443,PROXY \

关于centos - 无法在端口 80 CentOS v7.9.2009 kvm [ns] 上启动 Varnish - 错误 : -a arguments localhost:8443 and localhost:8443 have same address,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71319973/

相关文章:

reverse-proxy - Varnish 3.0 是如何处理 gzip 的?

php - 使用 Varnish HTTP 加速器清除目录下的所有文件

linux - 在 CentOS 5.x/6.x 上安装 Mono 和 Monodevelop

plugins - RabbitMQ MQTT 插件无法启动

logstash - 如何获得总结的 Varnishlog

varnish - 根据 cookie 中的值为同一页面提供不同的 Varnish 缓存?

ruby-on-rails-3 - 使用 capistrano 和 passenger 部署 Rails 应用程序时,应该如何设置用户权限?

mongodb - 如何在 hostgator VPS 中安装 mongodb 扩展?

python - 如何在 Centos 6.8 上安装 OpenCV 3?

caching - 带有 json 内容类型的 Varnish 缓存未命中