我正在尝试重新启动我的Apache,但是它不起作用。这是一个错误:
Restarting web server apache2
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message我需要些帮助。谢谢
发布于 2014-08-07 13:26:24
当域名被附加到主机名时,主机名被称为完全限定。
服务器名不是完全限定的,servername.domainname.org是。
当命令hostname用于返回系统的主机名时,hostname -f用于返回完全限定的主机名。
如果您在您的系统上运行了这个命令,并且它没有返回任何内容,那么在Apache和其他一些程序中,您可能会看到这个警告。
在这种情况下,如果您真的想解决问题,就必须相应地定义/etc/hosts:
<your ip> servername.domainname servername例如,如果我的IP为10.1.1.1,域example.com和主机名为host1,则最小的/etc/hosts文件为:
127.0.0.1 localhost.localdomain localhost
10.1.1.1 host1.example.com host1之后,命令hostname将返回host1,hostname -f返回host1.example.com。
这样做,就不需要告诉Apache主机名是localhost。不需要修改主要的Apache配置文件,所以下次更新Apache时,您不会松开设置,也不会将新的配置文件合并到现有的配置文件中。
https://askubuntu.com/questions/329318
复制相似问题