端口是免费的,但是 Apache 失败了:“地址已经在使用中:make_sock:无法绑定到地址”

web*_*oss 2 rhel4 apache-2.2

Apache (Linux Red Hat 4.1.x) 无法启动并显示消息:“地址已在使用中:make_sock:无法绑定到地址”。

# /etc/init.d/httpd start
Starting httpd: (98)Address already in use: 
make_sock: could not bind to address 0.0.0.0:8000
no listening sockets available, shutting down
Unable to open logs
                                                       [FAILED]
Run Code Online (Sandbox Code Playgroud)

已经尝试做:

killall -9 httpd
Run Code Online (Sandbox Code Playgroud)

看起来 Apache 没有运行。端口 8000 如果空闲,则没有什么可以阻止 Apache 占用它。(nginx 是 :80 作为反向代理)

 # netstat -tulpn| grep :80
 tcp  0   0 0.0.0.0:8001    0.0.0.0:*   LISTEN 17181/DarwinStreami
 tcp  0   0 0.0.0.0:80      0.0.0.0:*   LISTEN 7962/nginx.conf
Run Code Online (Sandbox Code Playgroud)

可能有人会对如何解决这个问题有任何想法?

UPD1: Apache 配置选项是:

ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 5

<IfModule prefork.c>
StartServers       1
MinSpareServers   5
MaxSpareServers   20
ServerLimit     200
MaxClients  200
MaxRequestsPerChild 2000

User apache
Group apache

DocumentRoot "/var/www/html"

NameVirtualHost *:8000
Run Code Online (Sandbox Code Playgroud)

UPD2:未找到 Pid:

# ls /etc/httpd/run/*.pid
/etc/httpd/run/crond.pid          /etc/httpd/run/sshd.pid
/etc/httpd/run/dhclient-eth0.pid  /etc/httpd/run/streamingadminserver.pid
/etc/httpd/run/haldaemon.pid      /etc/httpd/run/syslogd.pid
/etc/httpd/run/messagebus.pid     /etc/httpd/run/syslog-ng.pid
/etc/httpd/run/nginx.pid          /etc/httpd/run/xfs.pid
Run Code Online (Sandbox Code Playgroud)

UPD3:服务器重启没有帮助;)

UPD4: nc -l 8000工作正常,所以问题不在于 8000 端口,而在于 Apache 本身。

UPD5: "# /usr/sbin/lsof -i :8000" - 不输出

Mir*_*ici 9

您对同一个套接字多次使用 Listen 指令。使用grep -r Listen /etc/httpd/conf.d/*.conf /etc/httpd/conf/httpd.conf找到罪魁祸首。

apache 文档

错误条件
同一 IP 地址和端口的多个侦听指令将导致地址已在使用错误消息。