我的Windows 7上安装了IIS,默认端口为80,可以在http://localhost
上访问。现在我已经安装了XAMPP,并设置了端口8081,因此我可以在http://localhost:8081
上访问它。为apache添加虚拟主机
现在,我只想为XAMPP添加虚拟主机,这样我可以通过http://test/
,而不是http://localhost:8081
访问它。我不想在IIS地址中进行任何更改,并希望保持其地址相同。为此,我在我的XAMPP /阿帕奇/ conf目录/额外/的httpd-conf的文件即添加虚拟主机,
NameVirtualHost *:8081
<VirtualHost *:8081>
ServerAdmin [email protected]
DocumentRoot "C:/xampp/htdocs"
ServerName test
ServerAlias test
</VirtualHost>
我已经重新启动了Apache,但仍然无法访问地址http://test
。我错过了什么或做错了什么?
有没有办法让它在没有端口号的情况下工作? – user1355300 2012-07-09 06:01:36
@ user1355300 - 看到我上面的更新,希望有所帮助 – 2012-07-09 06:11:06