Apache 不会停止

Apache 不会停止

这是在 Amazon Linux 实例上(显然基于 CentOS 6)

# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:8080
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:8080
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

显然,由于停止失败,它不会启动。但是,为什么它一开始就不停止呢?我可以一遍又一遍地输入“service httpd stop”,但它只是不断打印 [FAILED]。“killall httpd”工作正常。

在执行 kill 和 service httpd start 后,stop 会再次正常工作一段时间。最令人不安。

Server version: Apache/2.2.24 (Unix)
Server built:   May 20 2013 21:12:45

答案1

您是否正在清理/删除服务锁定文件?它可能存储在 /var/run/httpd.pid 中。如果删除该文件,CentOS 服务基础架构将不知道 Apache 正在运行,也不知道它正在使用哪个进程 ID。因此无法停止它。

相关内容