重新启动apache时httpd(无pid文件)未运行

use*_*503 5 ubuntu httpd web-server apache-2.2

我在 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
Run Code Online (Sandbox Code Playgroud)

尝试时我收到以下消息 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          
Run Code Online (Sandbox Code Playgroud)

Are*_*tar 1

只需杀死 apache pid (我认为它是“kill 9950”)

然后尝试 /etc/init.d/apache2 start

  • 意识到每次我杀死 httpd 时 apachectl 都会自动重新启动。我停止它的方法是从 launchctl 卸载它: `sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist` (2认同)