apache 启动报错
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[root@web ~]# vi /etc/httpd//conf/httpd.conf
添加 ServerName localhost:8
重启 apache服务正常
报错情况2
httpd: apr_sockaddr_info_get() failed for web
这个问题应该是没有在 /etc/httpd/conf/httpd.conf 中设定 ServerName。所以apache会用主机上的名称来取代,首先会去找 /etc/hosts 中有没有主机的定义。
(1)ServerName localhost:80
或者在 /etc/hosts 中填入自己的主机名称 bogon,如下:
(2)127.0.0.1bogon
注意:
当前系统的主机名请以hostname命令为准,/etc/sysconfig/network中的HOSTNAME设置有可能不一致。
/etc/sysconfig/network 默认主机名是:HOSTNAME=localhost.localdomain
转载于:https://blog.51cto.com/xk7712/1367525