无法可靠地确定服务器的完全限定域名

mah*_*esh 101 fedora apache2

我刚刚安装了Apache 2.2.17,我第一次使用它.

现在,当我尝试使用该命令启动服务器时,service httpd start它向我提供了以下消息:

httpd:无法可靠地确定服务器的完全限定域名,使用:: 1表示ServerName

现在我想我必须在搜索Google时设置ServerName和IP地址.但我不知道我必须设置哪个文件.

我该如何解决这个问题?

小智 77

  1. sudo vim /etc/apache2/httpd.conf
  2. 在httpd.conf中插入以下行: ServerName localhost
  3. 只需重新启动Apache: sudo /etc/init.d/apache2 restart

  • 在我的RPi上,我必须将httpd.conf文件放在/etc/apache2/conf.d中才能工作. (2认同)

noo*_*odl 62

是的,您应该设置ServerName:

http://wiki.apache.org/httpd/CouldNotDetermineServerName

http://httpd.apache.org/docs/current/mod/core.html#servername

您可以在此处找到有关各种httpd分发使用的布局的信息:

http://wiki.apache.org/httpd/DistrosDefaultLayout

在您的情况下,要编辑的文件是/etc/httpd/conf/httpd.conf


zza*_*per 14

我没有得到ServerName错误.在导致此警告消息的VirtualHost配置中,它是httpd.conf顶部附近的通用配置,默认情况下已注释掉.

更改

#ServerName www.example.com:80
Run Code Online (Sandbox Code Playgroud)

至:

  ServerName 127.0.0.1:80
Run Code Online (Sandbox Code Playgroud)


Ber*_*fez 10

在Debian Squeeze下;

  1. 编辑Apache2 conf文件:vim /etc/apache2/apache2.conf
  2. 在apache2.conf中插入以下行:ServerName localhost
  3. 重启Apache2:apache2ctl restart或/etc/init.d/apache2 restart

应该工作正常(它确实解决了我的问题)

tks noodl为不同布局的链接.:)


Yev*_*yev 5

  1. sudo nano /etc/apache2/httpd.conf
  2. ServerName在 nano 编辑器中搜索文本<Ctrl + W>
  3. 在 httpd.conf 中插入以下行: ServerName localhost
  4. 只需重新启动Apache: sudo /usr/sbin/apachectl restart