我从来没有遇到过这个错误。 其次,我想知道你们如何debugging你的Apacheconfiguration。
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
在我的虚拟主机configuration中,我确实有这些行:
ServerName example.com ServerAlias www.example.com
(当然它有我的实际信息在那里)
所以我想我的问题是,为什么不能apache能够确定我的完全合格的域名?
检查你的/etc/hosts文件。 它应该看起来像这样:
127.0.0.1 localhost abcd www.example.com
第一行应该已经在那里,你只需要添加你的值的第二行。
我认为这是因为你需要在vhostconfiguration之外声明“ServerName”,在/ etc / hosts中声明的apache2.conf和ServerName值
除了已经提到的几点( /etc/hosts和虚拟主机外的ServerName指令)之外,还可以为系统正确设置hostname值。 使用hostname命令(以root用户或sudo)来设置它。 (如果你这样做,而不做另外两个,错误将继续,但它将取代“使用127.0.0.1 for ServerName”与“使用[ hostname的值]为ServerName”。