Apache 无法在 Ubuntu 12.10 中启动:没有可用的监听套接字

Apache 无法在 Ubuntu 12.10 中启动:没有可用的监听套接字

我无法在运行 Ubuntu 12.10 的开发机器上启动全新的 apache2 安装。

michal@ubuntudesktop:~$ sudo service apache2 start
 * Starting web server apache2
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
                                        [fail]

网络状态:

michal@ubuntudesktop:~$ sudo netstat -lnp | grep '80'
unix  2      [ ACC ]     SEQPACKET  LISTENING     6801     359/udevd           /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     14537    2180/dbus-daemon    @/tmp/dbus-9uSpG5NRQ5

lsof:

michal@ubuntudesktop:~$ sudo lsof -i :80
COMMAND    PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
ubuntu-ge 2425 michal   11u  IPv4  17679      0t0  TCP ubuntudesktop.local:42280->mistletoe.canonical.com:http (CLOSE_WAIT)
opera     3278 michal   19u  IPv4 156420      0t0  TCP ubuntudesktop.local:56934->s3-1-w.amazonaws.com:http (ESTABLISHED)
opera     3278 michal   78u  IPv4 126955      0t0  TCP ubuntudesktop.local:53709->69.59.197.29:http (ESTABLISHED)
opera     3278 michal   82u  IPv4 128928      0t0  TCP ubuntudesktop.local:53725->69.59.197.29:http (ESTABLISHED)
opera     3278 michal   83u  IPv4 128632      0t0  TCP ubuntudesktop.local:53718->69.59.197.29:http (ESTABLISHED)
chrome    3708 michal   69u  IPv4 149458      0t0  TCP ubuntudesktop.local:53771->69.59.197.29:http (ESTABLISHED)
chrome    3708 michal  119u  IPv4 146963      0t0  TCP ubuntudesktop.local:46290->we-in-f139.1e100.net:http (ESTABLISHED)
chrome    3708 michal  120u  IPv4 146964      0t0  TCP ubuntudesktop.local:46291->we-in-f139.1e100.net:http (ESTABLISHED)
chrome    3708 michal  146u  IPv4 147990      0t0  TCP ubuntudesktop.local:36624->muc03s01-in-f31.1e100.net:http (ESTABLISHED)

Apache 的 ports.conf:

NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

任何帮助都感激不尽。

更新:这是错误日志的内容/var/log/apache2/error.log

[Mon Nov 05 06:13:28 2012] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations
[Mon Nov 05 06:13:44 2012] [notice] caught SIGTERM, shutting down

更新 #2:唯一的Listen指令是 ports.conf 中列出的指令,见上文。

更新 #3:strace 输出:sudo strace -f /etc/init.d/apache2 start http://paste.ubuntu.com/1346460/

答案1

尝试使用此命令来查看 apache 正在尝试使用哪些端口:

strace -f /etc/init.d/apache2 start 2>&1 | grep bind

答案2

您可能需要查看您的 Apache 配置,也许有一个重复的 Listen 指令。

如果您提供 Apache 错误日志的输出,那也会很有帮助。

相关内容