我知道这个问题已经被关注了很多,但这里的解决方案并没有解决它们。
让我们从一些背景信息开始:
OS X 10.8.4 阿帕奇 2.2.22
问题:我在控制台中收到此错误,Apache 找不到我的本地主机,但启动正常。诡异的。
[Sat Aug 17 13:40:06 2013] [info] mod_ssl/2.2.22 compiled against Server: Apache/2.2.22, Library: OpenSSL/0.9.8r
httpd: Could not reliably determine the server's fully qualified domain name, using Specter.local for ServerName
所以通常这将指向我的 ServerName 设置不正确。嗯,它是:/ 我尝试过不同的变体,如 Spectre.local、localhost 等
这是我的 /private/etc/httpd.conf 的副本,这与 /private/etc/apache2/httpd.conf 相同
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName localhost
我的主机文件设置如下:
127.0.0.1 localhost localhost.local
255.255.255.255 broadcasthost
127.0.0.1 themill.dev
127.0.0.1 phpmyadmin.dev
127.0.0.1 Specter.local
在我的 /private/etc/apache2/users/ta.conf 中如下
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
# DEV: THEMILL SITE
<VirtualHost *:80>
ServerAdmin test@dummy.com
DocumentRoot "/Users/ta/Sites/themill/htdocs"
ServerName themill.dev
ServerAlias *.themill.dev
ErrorLog "/Users/ta/Sites/themill/log/error_log"
CustomLog "/Users/ta/Sites/themill/log/access_log" common
</VirtualHost>
# PHPMYADMIN
<VirtualHost *:80>
ServerAdmin test@dummy.com
DocumentRoot "/Users/ta/Sites/phpmyadmin"
ServerName phpmyadmin.dev
ServerAlias *.phpmyadmin.dev
ErrorLog "/Users/ta/Sites/phpmyadmin/log/error_log"
CustomLog "/Users/ta/Sites/phpmyadmin/log/access_log" common
</VirtualHost>
不确定还应该配置什么。它曾经可以工作,但在 10.7 升级后,它从来没有工作过,现在我正在尝试解决它,它正在努力。
如果您需要更多信息,请告诉我。