Centos下apache启动时httpd: apr_sockaddr_info_get() failed for 报错

  今天安装Apache httpd web服务器时,从官方网站上http://www.apache.org/dyn/closer.cgi下载httpd,然后在centos下解压,安装过程分为三部分:

      (1)./configure

      (2)make

      (3)make install (需要root权限)

默认安装在/usr/sbin/下,执行apachectl start时候,提示如下错误:

httpd: apr_sockaddr_info_get() failed for shiwei
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

于是上网查了一下,根据前人的经验,问题终于解决了。总结一下,方便以后使用。

原因:这个问题应该是没有在 /etc/httpd/conf/httpd.conf 中设定 ServerName。所以apache会用主机上的名称来取代,首先会去找 /etc/hosts 中有没有主机的定义。

解决办法:

(1)可以设定httpd.conf文件中的 ServerName,如下:ServerName localhost:80                        

(2)在 /etc/hosts 中填入自己的主机名称 bogon,如下:127.0.0.1 shiwei (用户名称)

 参考网址:

http://suo.iteye.com/blog/1096296

http://blog.chinaunix.net/uid-21516619-id-1824989.html

http://blog.csdn.net/lyjtynet/article/details/4213173

 

posted @ 2013-10-07 10:20  Rabbit_Dale  阅读(39599)  评论(0编辑  收藏  举报