操作系统:OS X 10.6.8
运行 Xampp
我的主机文件有问题,无法找出问题所在。
主机文件
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 proj.dev
::1 proj.dev
Xampp 中的虚拟主机
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
ServerName localhost
<Directory "/Applications/XAMPP/xamppfiles/htdocs">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/davey/Dropbox/proj"
ServerName amas.dev
<Directory "/Users/davey/Dropbox/proj">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
尽管使用 Terminal 多次重新启动和刷新缓存,但我无法让它工作。在终端中,ping 让我得到这个结果:
rafter:~ davey$ ping proj.dev
PING amas.dev (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.053 ms
*snip*
64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.116 ms
^C
--- amas.dev ping statistics ---
8 packets transmitted, 8 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.053/0.109/0.121/0.021 ms
然而下面的命令是这样的:
rafter:~ davey$ host proj.dev
Host proj.dev not found: 3(NXDOMAIN)
完全死胡同,不知道该怎么办。有任何想法吗?
我一直在使用 Smultron、pico 和 nano 对文件进行各种编辑。Tomcat 已安装,但未运行。
编辑
好吧,我想我可能缩小了范围。在终端中,我得到以下信息:
rafter:~ davey$ host -v amas.dev
Trying "amas.dev"
Received 101 bytes from 134.226.32.57#53 in 0 ms
Trying "amas.dev.scss.tcd.ie"
Host amas.dev not found: 3(NXDOMAIN)
Received 91 bytes from 134.226.32.57#53 in 1 ms
该 IP 号码是网络上的代理。这有什么区别吗?