前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >apache服务器启动时提示httpd: apr_sockaddr_info_get() faile

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

作者头像
院长技术
发布2020-06-13 11:22:08
1.5K0
发布2020-06-13 11:22:08
举报
文章被收录于专栏:院长运维开发院长运维开发

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 (这是操作系统默认安装路径)

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档