我有一个通过 MAMP Pro 在我的 Mac 上运行的虚拟主机。看完这个:从局域网上的任何计算机访问 Apache VirtualHost?我决定检查我的 httpd-vhosts.conf 文件,看看是否使用了正确的设置。
我没有触及单个 Apache 配置文件来启动和运行这些虚拟主机,因为 MAMP Pro 提供了一个允许我这样做的界面(即:http: //i.imgur.com/zmgkiNg.png)。我检查了我../conf/Apache/extra/httpd-vhosts.conf
的是否有任何更改,但没有。这是文件的内容:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/Applications/MAMP/Library/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error_log"
CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "/Applications/MAMP/Library/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error_log"
CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>
(浓缩,这是文件的完整内容:http: //pastie.org/9158063)
在哪里可以找到相关httpd-vhost.conf
文件?更改我上面提供的链接中指出的一行代码是否允许从另一台设备访问虚拟主机?