启动Apache httpd服务报以下错误:
~ % sudo apachectl start
Password:
AH00557: httpd: apr_sockaddr_info_get() failed for allard
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
报错意思:AH00558: httpd:不能可靠地确定服务器的完全限定域名,使用127.0.0.1。全局设置'ServerName'指令来抑制此消息。
解决办法:
~ % cd /usr/local/etc/httpd/
httpd % ls
extra httpd.conf magic mime.types original
httpd % sudo vim httpd.conf
# 搜索找到 ServerName,添加如下信息
#ServerName www.example.com:8080
ServerName localhost:80
# 再次运行启动httpd服务无问题
httpd % sudo apachectl start