Apache启动不了httpd: apr_sockaddr_info_get() failed xgp
httpd: apr_sockaddr_info_get() failed for hoteel
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
我在service httpd restart的时候提示上述信息的。虽然启动成功了,但是也是很郁闷的。
这是因为我在配置DNS的时候hostname hoteel造成的。
重新hostname localhost就可以了。
我在网上找来一些有关这方面的信息,就顺便贴在这里了。
1
在启动 httpd 时出现
Starting httpd: httpd: apr_sockaddr_info_get() failed for MYHOST
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 所以它会用主机上的名称来取代,首先会去找 /etc/hosts 中有没有主机的定义。
所以要解决这个问题可以设定 ServerName 或者在 /etc/hosts 中填入自己的主机名称 MYHOST,像这样:
>vi /etc/hosts
127.0.0.1 localhost.localdomain localhost MYHOST
2
在Linux下安装完Apache 2.2.6,启动HTTP服务就报错,似乎不影响服务的使用,但是也挺别扭的。
[root@linux http]# ./apachectl start
httpd: apr_sockaddr_info_get() failed for linux(在BSD上是apr_sockaddr_info_get() failed for freebsdla)
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
经分析发现是apache的conf目录下的配置文件httpd.conf中关于hostname设置和/etc/sysconfig/network中的HOSTNAME设置不统一导致的,修改成统一的主机名即可解决该问题。
注:/etc/sysconfig/network 默认主机名是:HOSTNAME=localhost.localdomain
PS:网上有这种办法,似乎是没用的,因为我认为apache在编译安装过程中会编译ARP的,因此下述操作有点多余。
apr 和apr-util包含在Apache httpd的发行源代码中,并且在绝大多数情况下使用都不会出现问题。当然,如果apr或apr-util的1.0或1.1版本已经安装在你的系统中了, 则必须将你的apr/apr-util升级到1.2版本,或者将httpd单独分开编译。要使用发行源代码中自带的apr/apr-util源代码进行安 装,你必须手动完成:
# 编译和安装 apr 1.2
apr
./configure --prefix=/x/httpd/apr
make
make install
apr-util
./configure --prefix=/x/httpd/apr_util --with-apr=/x/httpd/apr
make
make install
apache
./configure --prefix=/x/httpd/apache2 \
--enable-so \
--enable-cgi \
--enable-rewrite \
--enable-mods-shared=all \
--with-apr=/x/httpd/apr \
--with-apr-util=/x/httpd/apr_util
LDFLAGS="-L/usr/lib64 -L/lib64"
本机正确设定说明 必须为同一的
[root@spring ~]# nl /etc/hosts
1 # Do not remove the following line, or various programs
2 # that require network functionality will fail.
3 127.0.0.1 localhost.localdomain spring
[root@spring ~]# nl /etc/sysconfig/network
1 NETWORKING=yes
2 NETWORKING_IPV6=no
3 HOSTNAME=spring
4 #GATEWAY=192.168.8.1
[root@spring ~]# less /etc/httpd/conf/httpd.conf|grep ServerName
# ServerName gives the name and port that the server uses to identify itself.
#ServerName www.example.com:80
ServerName 127.0.0.1
版权声明:本文为小平果原创文章,转载请注明:http://blog.csdn.net/i10630226
Apache启动不了httpd: apr_sockaddr_info_get() failed xgp的更多相关文章
- apache服务器启动时提示httpd: apr_sockaddr_info_get() failed for
apache服务器启动时提示httpd: apr_sockaddr_info_get() failed for 在RedHat Linux 5 与 CentOS 5服务器上配置好apache后,启动或 ...
- Apache启动提示 httpd: apr_sockaddr_info_get() failed for xxx
httpd: apr_sockaddr_info_get() failed for xxx httpd: Could not reliably determine the server's fully ...
- Centos下apache启动时httpd: apr_sockaddr_info_get() failed for 报错
今天安装Apache httpd web服务器时,从官方网站上http://www.apache.org/dyn/closer.cgi下载httpd,然后在centos下解压,安装过程分为三部分: ( ...
- 如何解决linux下apache启动时httpd: apr_sockaddr_info_get() failed for 报错
今天在家里的RHLE5.5上安装apache的时候,先用user1用户./configure命令配置,然后才用root用户make && make install,结果apache起来 ...
- 解决Apache启动错误:httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
启动apache遇到提示: [root@bqh-119 conf]# ../bin/apachectl -thttpd: apr_sockaddr_info_get() failed for bqh- ...
- httpd: apr_sockaddr_info_get() failed for bogon
AH00557: httpd: apr_sockaddr_info_get() failed for bogon AH00558: httpd: Could not reliably determin ...
- 解决apache启动错误 AH00558: httpd: Could not reliably determine...
[root@localhost httpd-2.4.7]# /usr/local/httpd/bin/apachectl start AH00558: httpd: Could not reliabl ...
- 解决apache启动问题:httpd: Could not reliably determine the server's fully
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for Se ...
- 解决启动httpd报: apr_sockaddr_info_get() failed for错误
我测试库里 service httpd start 时报 下面错误 httpd: apr_sockaddr_info_get() failed for fengxin.wzjzt.centoshttp ...
随机推荐
- 8 个实用的 Bootstrap 3 案例教程
Bootstrap 3发布各大设计论坛议论纷纷.这次Bootstrap 3最大的特点就是--扁平化.下面就是一些早期的Bootstrap 3例子,不过亲们注意咯,因为大部分最早期的测试案例,可能用到一 ...
- iPhone开发初探
本文是作者从一无所知到入门的知识学习过程,并结合自己在嵌入式开发的经验所写的技术总结文章,以供后来者学习. 苹果公司的iphone平台采用Object-c做为native language的开发,Ob ...
- MySQL 和 JDBC(Java数据库连接)
1.MySQL 1.1 MySQL简介 a)MySQL是一个开源免费的关系型数据库管理系统. b)默认用户:root c)默认端口号: 2.MySQL常用命令 2.1连接MySQL mysql ...
- Mac 电脑前端环境配置
恍惚间,好久没有在外面写过随笔了.在阿里的那两年,学到了许多,也成长了许多,认识了很多可爱的人,也明白了很多社会的事.最后种种艰难抉择,我来到了美团成都,一个贫穷落后但更自由开放弹性的地方.已经误以为 ...
- geth常用指令
ubuntu下载: https://github.com/ethereum/go-ethereum/wiki/Installation-Instructions-for-Ubuntu sudo apt ...
- Android两级嵌套ListView滑动问题的解决
Android下面两级嵌套ListView会出现滑动失效,解决方案,把两级Listview全换成NoScrollListView,代码如下: public class NoScrollListView ...
- pydev 下Django 1.7 undefined variables from import问题的解决
参考:http://stackoverflow.com/questions/24951029/pydev-django-undefined-variables-from-import 参考上面的帖子认 ...
- 关于前端本地压缩图片,兼容IOS/Android/PC且自动按需加载文件之lrz.bundle.js
一.介绍说明主要特点: ①在前端压缩好要上传的图片可以更快的发送给后端,因此也特别适合在移动设备上使用. ②兼容IOS/Android,修复了IOS/Android某些版本已知的BUG. ③按需加载文 ...
- java线程之线程通信控制
在上篇我们看到,A线程往公共资源库(对象)提供了一条数据,然后B线程从库中提取了数据并打印出来. 实际项目中,我们不可能只往库中提供一条数据,而且库的大小也不会是无穷大的,那么我们就会有这样一 个需求 ...
- Elasticsearch 编程API入门系列---说在前面的话
前提,是 Eclipse下Maven新建项目.自动打依赖jar包(包含普通项目和Web项目) setting.xml配置文件 如何在Maven官网下载历史版本 HBase 开发环境搭建(Eclipse ...