Could not reliably determine the servers fully qualified domain name

Could not reliably determine the servers fully qualified domain name

刚从CentOS用yum命令安装好Apache,在没有进行任何配置的默认情况之下,执行以下启动命令:

service httpd restart


出现了以下错误提示:

httpd: Could not reliably determine the server's 
fully qualified domain name, using localhost.localdomain for ServerName


从字面上翻译,可以理解到ServerName没有设置,可以修改httpd.conf,找到类似一下的这一行:

#ServerName www.example.com:80

改成:

ServerName localhost:80

重新启动即可。主要是要把改行前面的“#”号去掉。


PS:默认情况下,CentOS的apache配置文件位于“/etc/httpd/conf/httpd.conf”。


2