【发布时间】:2012-07-08 12:39:34
【问题描述】:
我在 Windows 7 上安装了 IIS,它使用默认端口 80,可以通过 http://localhost 访问。现在我也安装了XAMPP并设置了8081端口,所以我可以通过http://localhost:8081访问它。
现在,我只想为 xampp 添加虚拟主机,以便我可以通过 http://test/ 而不是 http://localhost:8081 访问它。我不想对 IIS 地址进行任何更改,并希望保持其地址不变。为此,我在我的 xampp/apache/conf/extra/httpd-conf 文件中添加了虚拟主机,即,
NameVirtualHost *:8081
<VirtualHost *:8081>
ServerAdmin admin@localhost.com
DocumentRoot "C:/xampp/htdocs"
ServerName test
ServerAlias test
</VirtualHost>
我已经重启了apache,但仍然无法访问地址http://test。我错过了什么或做错了什么?
【问题讨论】:
标签: apache xampp localhost virtualhost