现象:
# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: [Mon Mar 04 04:05:12 2013] [warn] module limitipconn_module is already loaded, skipping
httpd: Could not reliably determine the server's fully qualified domain name, using Xfor ServerName
[Mon Mar 04 04:05:12 2013] [warn] NameVirtualHost *:443 has no VirtualHosts
[Mon Mar 04 04:05:12 2013] [warn] NameVirtualHost *:80 has no VirtualHosts
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
~~~~~~~
原因:
Normally a "could not bind to address" error means that another process
is bound to port 80 preventing Apache from starting up on that port.
This can happen if you are you using a caching server or another web
server that is also using port 80, If this is the case, stop this
alternate process and try restarting Apache again.
解决链接:
http://stackoverflow.com/questions/9757599/apache-restart-failed
要用到KILL命令,我开始找的PKILL或是KILL PROC命令在CENTOS下并不通用。
~~~~~~~~~~~
首先,确定HTTPD的PID。
ps -ef|grep httpd
root 2213 1 0 Mar02 ? 00:00:39 /usr/sbin/httpd
apache 7641 2213 2 03:16 ? 00:01:09 /usr/sbin/httpd
。。。
apache 11050 2213 2 04:05 ? 00:00:03 /usr/sbin/httpd
显然,parent httpd process id为2213。
然后,kill 2213
再运行service httpd start,
搞定,收工。