gentoo apache2 启动失败解决

安装 apache2 后,启动总是错误

sunshine@gentoo /etc/apache2 $ sudo /etc/init.d/apache2 start

 * Starting apache2 ...

apache2: apr_sockaddr_info_get() failed for gentoo

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

 * start-stop-daemon: failed to start `/usr/sbin/apache2'

                                                                                                               [ ok ]

 

用 strace 跟踪也找不到问题

去看 apache2 的log 

tail -f /var/log/apache2/error_log

[Sun Oct 30 20:29:34 2011] [alert] (EAI 3)Temporary failure in name resolution: mod_unique_id: unable to find IPv4 address of "gentoo"

Configuration Failed

google之,最后锁定问题关键,gentoo 这个hostname找不到ip地址..

操蛋,怎么也想不到这里有问题

sunshine@gentoo /var/log/apache2 $ hostname 

gentoo

hostname 果然是gentoo,当时配置的时候想要让别人在网络上知道我是用的gentoo,所以用的这个名字。

所以在 /etc/hosts 中加入 gentoo 别名对应的本机ip就ok了

sunshine@gentoo ~ $ cat /etc/hosts

127.0.0.1       gentoo localhost localhost.localdomain localhost4 localhost4.localdomain4

::1             gentoo localhost localhost.localdomain localhost6 localhost6.localdomain6

再启动apache2就正常了,感谢google,和apache的log。

tail -f /var/log/apache2/error_log

[Sun Oct 30 20:33:48 2011] [notice] Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/1.0.0e configured -- resuming normal operations



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值