httpd(没有pid文件)没有运行时重新启动Apache

我正在Ubuntu的工作。 我尝试重新启动Apache时收到错误消息。

root@XXX:/etc/init.d# sudo /etc/init.d/apache2 restart * Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using xxx.xxx.xx.xxx for ServerName httpd (no pid file) not running apache2: Could not reliably determine the server's fully qualified domain name, using xxx.xxx.xx.xxx for ServerName (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 

尝试netstat -pant时,我收到以下消息

 tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 0 32748 9950/httpd tcp 429 0 xxx.xxx.xx.xxx:80 xxx.xxx.xx.xxx:xxxxx CLOSE_WAIT 0 0 

使用lsof -i :80 {检查参数是否正确)。 它列出了在端口80上侦听的所有应用程序。

也尝试运行apache2 {直接执行可执行文件}来检查发生了什么。

从其他人的post来看,这是由于某些应用程序绑定了80端口,所以只需发出“killall httpd”然后“apachectl start”就可以再次正常工作。

只要杀死Apache的PID(我认为它的“杀死9950”)

然后尝试/etc/init.d/apache2启动

使用pgrep apache2来获取进程列表