apr_sockaddr_info_get() failed for

Apache启动的时候,出现如下提示: 正在启动 httpd:httpd: apr_sockaddr_info_get() failed for xahost httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName这是为什么,怎么解决一下?
已邀请:

Ansible - 项目实施 系统工程师

> 原因:


这个问题是因为没有在 /etc/httpd/conf/httpd.conf 中设定 ServerName。所以apache会用主机上的名称来取代,首先会去找/etc/hosts中有没有主机的定义。
> 解决办法:


(1)可以设定httpd.conf文件中的 ServerName,如下:ServerName 0.0.0.0:80 脚本:sed -i 's@#ServerName www.example.com:80@ServerName 0.0.0.0:80@g' /etc/httpd/conf/httpd.conf

(2)在 /etc/hosts 中填入自己的主机名称 xahost,如下:127.0.0.1 xahost
 

要回复问题请先登录注册