博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
apache服务器启动时提示httpd: apr_sockaddr_info_get() failed for
阅读量:4053 次
发布时间:2019-05-25

本文共 930 字,大约阅读时间需要 3 分钟。

apache服务器启动时提示httpd: apr_sockaddr_info_get() failed for

在RedHat linux 5 与 CentOS 5服务器上配置好apache后,启动或者关闭时总要报个错:

httpd: apr_sockaddr_info_get() failed for XX(主机名)

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

虽然说并不影响apache的正常启动!但总感觉好像哪有问题。因为进程里会卡一个apache启动进程

找了下资料,原来是主机名设置不对造成的!没有在 /etc/httpd/conf/httpd.conf 中设定 ServerName 所以它会用主机上的名称来取代,首先会去找 /etc/hosts 中有没有主机的定义。

所以要解决这个问题可以设定 ServerName 或者在 /etc/hosts 中填入自己的主机名称 MYHOST,像这样:
>vi /etc/hosts
127.0.0.1   localhost.localdomain   localhost   XX(主机名)

查看主机名的命令是:hostname

 

可能出现的另外的错误:

[root@bogon xy]# service httpd restart

Stopping httpd: [  OK  ]
Starting httpd: httpd: apr_sockaddr_info_get() failed for bogon
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

解决方法:

将httpd.conf中的ServerName 前面的 # 去掉。

RedHat 5 与 CentOS 中的配置文件在 /etc/httpd/conf/httpd.conf   (这是操作系统默认安装路径)

转载地址:http://bnxci.baihongyu.com/

你可能感兴趣的文章
Mac环境下svn的使用
查看>>
github简单使用教程
查看>>
如何高效利用GitHub
查看>>
环境分支-git版本管理
查看>>
uni-app 全局变量
查看>>
js判断空对象的几种方法
查看>>
java 不用递归写tree
查看>>
springboot2 集成Hibernate JPA 用 声明式事物
查看>>
fhs-framework jetcache 缓存维护之自动清除缓存
查看>>
SpringBoot 动态编译 JAVA class 解决 jar in jar 的依赖问题
查看>>
fhs-framework springboot mybatis 解决表关联查询问题的关键方案-翻译服务
查看>>
ZUUL2 使用场景
查看>>
Spring AOP + Redis + 注解实现redis 分布式锁
查看>>
elastic-job 和springboot 集成干货
查看>>
php开发微服务注册到eureka中(使用sidecar)
查看>>
mybatis mybatis plus mybatis jpa hibernate spring data jpa比较
查看>>
支付宝生活号服务号 用户信息获取 oauth2 登录对接 springboot java
查看>>
CodeForces #196(Div. 2) 337D Book of Evil (树形dp)
查看>>
uva 12260 - Free Goodies (dp,贪心 | 好题)
查看>>
uva-1427 Parade (单调队列优化dp)
查看>>