由于“没有可用的套接字”错误,apache2将无法在启动时启动

当使用apache2版本2.2.22启动debian wheezy服务器时,apache autostart会失败,并显示以下错误:

 Starting web server: apache2(99)Cannot assign requested address: make_sock: could not bind to address [2a01:aaa:bbb:ccc::2]:80 no listening sockets available, shutting down Unable to open logs Action 'start' failed. 

我已经检查过,如果端口80已经被另一个使用netstat的进程使用 – 事实上并非如此。

ipv6设置是本地的,不使用任何隧道。 这是使用/etc/network/interfaces

 iface eth0 inet6 static address 2a01:aaa:bbb:ccc::2 netmask 64 gateway 2a01:aaa:bbb:ccc::1 

我也尝试设置由rc.d使用的S[xx]apache2数字高于所有其他进程的数字,仍然是相同的错误。

当以后使用/etc/init.d/apache2 start手动启动Apache /etc/init.d/apache2 start通过ssh /etc/init.d/apache2 start ,一切正常。

我怎么可能解决这个问题?

这听起来好像你试图在networking启动之前启动apache。 尝试在启动过程中稍后启动它。