我正在尝试为两个 Zend Framework 应用程序设置虚拟主机。我从更改system32 hosts
文件开始。
它现在包含以下几行:
127.0.0.1 localhost
# ::1 localhost
127.0.0.1 quickstart
之后,我继续更改httpd-vhosts.conf
文件。它的当前内容:
<VirtualHost *:80>
ServerAdmin postmaster@dummy-host2.localhost
DocumentRoot "G:\workspace\Andrew\ProjManer\public"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" combined
</VirtualHost>
<VirtualHost *:80>
ServerAdmin postmaster@dummy-host2.localhost
DocumentRoot "G:\workspace\Andrew\quickstart\public"
ServerName quickstart
ServerAlias quickstart
ErrorLog "logs/quickstart-error.log"
CustomLog "logs/quickstart-access.log" combined
</VirtualHost>
如果我不先用 localhost 添加虚拟主机,我会得到一个"Access forbidden 403 Error message"
.
现在的问题是两者都指向同一个位置,即本地主机。我应该如何让第二个虚拟主机工作?我用的flushdns
也。