我正在尝试重新启动Apache 2:
sudo service apache2 restart但是得到以下错误:
* 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我试着改变
sudo gedit /etc/apache2/httpd.conf出现一个空白文件,我添加了以下内容:
ServerName localhost但这个错误并没有消失!
我怎样才能解决这个问题?
发布于 2013-08-06 13:52:25
我发现了这个:当Apache无法确定域名时,如何重新启动/重新加载Apache?
好消息!Apache正在成功地重新启动。Apache只是不确定您想从哪里提供服务,所以默认选择本地主机(127.0.0.1)。为了防止此消息出现,请通过在
/etc/apache2/apache2.conf文件中添加以下行来澄清您希望从localhost (127.0.0.1)中提供服务: ServerName localhost
发布于 2014-03-10 20:03:08
在虚拟主机部分之外的配置文件中指定ServerName localhost是实现此操作的方法。
其他答案建议您修改/etc/apache2/httpd.conf。当apache从apt升级时,此文件将被覆盖。对于不想被覆盖的Apache配置,应该创建一个新文件。下面是进行此配置更改的"Debian方式“:
# create the configuration file in the "available" section
echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/servername.conf
# enable it by creating a symlink to it from the "enabled" section
sudo a2enconf servername
# restart the server
sudo service apache2 restart发布于 2014-03-02 12:36:31
本地主机IP地址应该是127.0.0.1,而不是127.0.1.1。请正确设置您的/etc/hosts文件。然后编辑httpd.conf文件:
sudo -H gedit /etc/apache2/httpd.conf当出现空白文件时,请添加这一行,然后保存:
ServerName localhosthttps://askubuntu.com/questions/329323
复制相似问题