【问题标题】:Could not reliably determine the server's fully qualified domain name after upgrading to Yosemite升级到 Yosemite 后无法可靠地确定服务器的完全限定域名
【发布时间】:2015-10-15 17:32:40
【问题描述】:

我升级到优胜美地,现在 apache 无法启动。我见过很多人遇到同样的问题,但他们提到的修复方法似乎都不起作用。

/etc/hosts:

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost

/etc/apache2/httpd.conf

ServerName localhost:80

【问题讨论】:

    标签: apache osx-yosemite


    【解决方案1】:

    我是 linux apache 用户,我注意到的事情很少。

    127.0.0.1          localhost
    255.255.255.255.   broadcasthost
    ::1                localhost
    fe80::1%lo0        localhost
    

    应该是这样,因为这是我的签名设置

    127.0.0.1          localhost.localdomain localhost
    255.255.255.0      broadcasthost
    ## not 255.255.255.255 as we are defining Apache the netmask
    ::1                localhost.localdomain localhost
    fe80::1%lo0        localhost.localdomain localhost
    

    localhost.localdomain localhost 使 Apache 能够在 LAN 上或通过 DNS 查找和查找主机(DNS 检查需要 localhost.domain.com 字符串。因此,对于主机或主机名的环回(local 或 local.mydomain.com)查询,这将使用此格式设置系统localhost.localdomain。实时示例:我的 7 个服务器主机名之一是 X7 和我的域,faron.ca。所以它会是这样的:

    127.0.0.1  localhost.localdomain localhost
    127.0.1.1  mail
    127.0.1.2  X7
    127.0.122.1 space
    
    192.168.125.7   mail.faron.ca
    192.168.7.127   X7.faron.ca  faron.ca  cloud.faron.ca  faronhost.ca 
    192.168.122.1   space.faron.ca   # this is virtual bridge LAN
    
     # The following lines are desirable for IPv6 capable hosts
     ::1     localhost ip6-localhost ip6-loopback
     ff02::1 ip6-allnodes
     ff02::2 ip6-allrouters
    

    【讨论】:

    • 我明白了...我将继续在 VM 上升级到 Yosemite,如果我设法让它工作,我会在这里发布。
    • 对于 ServerName,始终使用不带端口的完整限定域地址。端口已由机器定义。编辑到ServerName localhost 但是,我在使用localhost 时经常注意到棘手的区域。如果您坚持使用localhost,请改用127.0.0.1。它应该停止错误消息。
    • 再次感谢,但仍然一无所获。你介意为我区分一下吗? gist.github.com/cmillsLA/d83837a89254539ea827
    • 我已经通过几个文档和朋友的机器 /etc/apache2/httpd.conf /etc/apache2/extra/httpd-vhosts.conf /etc/hosts 浏览了所有这些内容还有其他会影响 ServerName 的文件吗?
    猜你喜欢
    • 2011-08-16
    • 2013-08-19
    • 1970-01-01
    • 2018-05-19
    • 2021-05-29
    • 2022-07-18
    • 2021-08-14
    • 1970-01-01
    • 2012-03-21
    相关资源
    最近更新 更多