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

来源:互联网 发布:淘宝手机神仙道辅助 编辑:程序博客网 时间:2024/06/04 19:48

安装报错

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

      (1)./configure      (2make      (3make install (需要root权限)

安装完成后,执行apachectl start时候,提示如下错误:

httpd: apr_sockaddr_info_get() failed for zuopu749httpd: 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 中有没有主机的定义。

解决办法:

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

  • /etc/hosts 中填入自己的主机名称bogon,如下:127.0.0.1 zuopu749

实践得知

  • 启用httpd.conf文件中的ServerName localhost:80
  • /etc/hosts文件中的 127.0.0.1::1后面都加一条zuopu749

参考网址:

  • http://suo.iteye.com/blog/1096296
  • http://blog.chinaunix.net/uid-21516619-id-1824989.html
  • http://blog.csdn.net/lyjtynet/article/details/4213173
0 0
原创粉丝点击