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]
已经尝试做:
killall -9 httpd
它看起来像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
可能有人会有任何想法如何解决这个问题?
UPD1: Apacheconfiguration选项是:
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
UPD2:未findPid:
# 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
UPD3:服务器重新启动不起作用;)
UPD4: nc -l 8000
工作正常,所以问题不在8000端口,而是Apache本身。
UPD5: “#/ usr / sbin / lsof -i:8000” – 不输出
您多次使用同一套接字的Listen指令。 使用grep -r Listen /etc/httpd/conf.d/*.conf /etc/httpd/conf/httpd.conf
find罪魁祸首。
从apache文档 :
错误情况
相同的IP地址和端口的多个侦听指令将导致地址已被使用错误消息。
我有时会在之前的apache停止时没有移除PID文件。 如果PID存在,请在再次启动之前尝试删除它。
我也有时候,当我试图启动apache使用一个帐户以外的configuration为运行Apacheconfiguration。