Apache启动时报错Could not reliably determine the server's fully qualified domain name

时间:2022-10-08 20:22:51

apache无法启动,提示:

正在启动 httpd:httpd: apr_sockaddr_info_get() failed for CentOS
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

原因:httpd.conf文件中未设置ServerName
解决方法:在httpd.conf文件中找到#ServerName www.example.com:80,去掉注释,将www.example.com:80改为本机IP:80