Apache2 无法通过重启关闭连接

Apache2 无法通过重启关闭连接

我正在运行带有 Apache2 的 Debian 网络服务器,重新启动命令开始出现错误。

root@srv:~# service apache2 stop
Stopping web server: apache2.
root@srv:~# service apache2 start
Starting web server: apache2(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
Action 'start' failed.
The Apache error log may have more information.
 failed!

有时它实际上会重新启动而不会出现问题,但通常我必须先 killall -9 apache2。Debian IRC 上的某个人让我检查我的活动 apache2 连接,结果发现它们没有退出,而且其中有几十个保持打开状态。我怎样才能让它们最终超时?

答案1

尝试

lsof -i :80

然后杀死相关的PID。

相关内容