无法停止端口 80 上的不可见套接字

无法停止端口 80 上的不可见套接字

我想运行我的 Apache 服务器但是出现了这个错误:

# /usr/sbin/httpd -k start
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs

我使用 netstat 检查哪个进程正在使用此端口,但没有得到任何回应:

# netstat -lnp | grep :80
#

在 httdp.conf 中,如果我更改监听端口和 SSL 端口,我可以正确启动我的服务器(但这不是我想要的):

Listen 8080
Listen 8443 https

我得到:

# /usr/sbin/httpd -k start
#

因此,有一个不可见的进程正在我的 80 和 443 端口上运行,我无法识别它。我还重新启动了服务器,但问题仍然存在。有什么想法吗?


回答评论中的问题:

# grep -R 'Listen' /etc/httpd
Binary file /etc/httpd/modules/mod_heartmonitor.so matches
Binary file /etc/httpd/modules/mod_pagespeed_ap24.so matches
Binary file /etc/httpd/modules/mod_mpm_prefork.so matches
Binary file /etc/httpd/modules/mod_mpm_event.so matches
Binary file /etc/httpd/modules/mod_pagespeed.so matches
Binary file /etc/httpd/modules/mod_mpm_worker.so matches
/etc/httpd/conf.d/mod_jk.conf:Listen *:80
/etc/httpd/conf.d/mod_jk.conf:Listen *:443
/etc/httpd/conf.d/ssl.conf:Listen 443 https
/etc/httpd/conf/httpd.conf:# Listen: Allows you to bind Apache to specific IP addresses and/or
/etc/httpd/conf/httpd.conf:# Change this to Listen on specific IP addresses as shown below to
/etc/httpd/conf/httpd.conf:#Listen 12.34.56.78:80
/etc/httpd/conf/httpd.conf:Listen 80

答案1

您可能有多个Listen主 httpd.conf 中的指令以及包含的子部分conf.d/*.conf和类似内容。

重叠的 Listen 指令将导致致命错误,从而阻止服务器启动。

相关内容