Apache2 无法启动 - 没有可用的侦听套接字 - ubuntu 14.04

Gar*_*ale 5 server apache2 webserver

我在 Xubuntu 14.04 上的 apache2 遇到了一些问题。这一切都发生在主板上的 BIOS 完全故障之后(现在已刷新到最新版本 - 到目前为止一切顺利),尽管它可能无关。

如果我重新启动系统 apache 不再自动启动。如果我手动启动该服务,我会收到以下消息:

 * Starting web server apache2                                                                                                                                          [Thu Sep 18 15:17:56.311536 2014]                                                                                        
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:8                                                                                      0
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.                                                                                        0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
 *
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Run Code Online (Sandbox Code Playgroud)

在做了一些研究之后,我发现我有一个 pid 号在启动时为 apache2 运行(运行后pidof apache2)。如果我运行killall apache2,live pid 就会消失。然后我可以启动 apache,它可以正常工作,没有错误,并且确实停止了。我可以永远停止和开始。似乎每当系统重新启动时,apache 都会以一个 pid 启动并开始侦听端口 80(阻止它),但不正确。因此,在重新启动后的那一刻,我必须运行 killall apache2 然后手动启动该服务。

如果在重新启动后我运行命令 sudo service apache2 restart (因为它应该已经在启动时运行)我收到这条消息 -

 * Restarting web server apache2                                         [fail]
 * There are processes named 'apache2' running which do not match your pid file which are left untouched in the name of safety, Please review the situation by hand.
Run Code Online (Sandbox Code Playgroud)

有没有人有任何想法?我会很高兴。

值得一提的是,我最近在服务器上启用了 SSL,并且在问题出现前一周运行良好。

日志 -

[Thu Sep 18 14:54:50.454133 2014] [mpm_prefork:notice] [pid 3005] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.4 OpenSSL/1.0.1f configured -- resuming normal operations    
[Thu Sep 18 14:54:50.454758 2014] [core:notice] [pid 3005] AH00094: Command line: '/usr/sbin/apache2'    
[Thu Sep 18 14:55:09.625943 2014] [mpm_prefork:notice] [pid 3005] AH00169: caught SIGTERM, shutting down    
[Thu Sep 18 14:55:16.061357 2014] [mpm_prefork:notice] [pid 3212] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.4 OpenSSL/1.0.1f configured -- resuming normal operations    
[Thu Sep 18 14:55:16.061455 2014] [core:notice] [pid 3212] AH00094: Command line: '/usr/sbin/apache2'    
[Thu Sep 18 14:58:39.984917 2014] [mpm_prefork:notice] [pid 3212] AH00169: caught SIGTERM, shutting down
Run Code Online (Sandbox Code Playgroud)

如果我在开始之前运行 killall apache2 命令 - 这些是日志条目,

[Mon Sep 22 09:38:14.689608 2014] [mpm_prefork:notice] [pid 2624] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.4 OpenSSL/1.0.1f configured -- resuming normal operations    
[Mon Sep 22 09:38:14.689695 2014] [core:notice] [pid 2624] AH00094: Command line: '/usr/sbin/apache2'
Run Code Online (Sandbox Code Playgroud)

非常感谢。

PS - 我对 linux 和服务器一般比较陌生,尽管我非常喜欢学习 linux 和设置我自己的家庭服务器。

Gar*_*ale 1

确实是我的 SSL 私钥上的 PEM 密码导致了问题。Apache 需要它在启动时进入,所以它挂起,有点半运行。我已经取消了密钥的加密,现在它可以正常启动了。非常感谢!!!