apache服务器启动时提示httpd: apr_sockaddr_info_get() failed forhtml
apache服务器启动时提示httpd: apr_sockaddr_info_get() failed forlinux
在RedHat Linux 5 与 CentOS 5服务器上配置好apache后,启动或者关闭时总要报个错: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启动进程dom
找了下资料,原来是主机名设置不对形成的!没有在 /etc/httpd/conf/httpd.conf 中设定 ServerName 因此它会用主机上的名称来取代,首先会去找 /etc/hosts 中有没有主机的定义。
因此要解决这个问题能够设定 ServerName 或者在 /etc/hosts 中填入本身的主机名称 MYHOST,像这样:
> vi /etc/hosts
127.0.0.1 localhost.localdomain localhost XX(主机名)ide
查看主机名的命令是:hostnamepost
可能出现的另外的错误:操作系统
[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.net
解决方法:rest
将httpd.conf中的ServerName 前面的 # 去掉。
RedHat 5 与 CentOS 中的配置文件在 /etc/httpd/conf/httpd.conf (这是操做系统默认安装路径)