您的位置:首页 > 大数据 > 人工智能

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

2015-10-04 14:35 513 查看

安装报错

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

(1)./configure

(2)make

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


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

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

解决办法:

可以设定
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  apache centos