WAMP 本地主机上的多个域
如果您正在阅读我的问题,谢谢,非常感谢您的帮助,
我正在 Windows Vista 上使用 Wamp。
我创建了 2 个项目文件夹:
www/project1/
www/project2/
我的虚拟主机文件如下所示:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/project1/"
ServerName project1.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/project2/"
ServerName project2.com
</VirtualHost>
有人可以建议我如何执行此操作吗?
If you're reading my question, thanks, I appreciate your help
I'm using Wamp on Windows Vista.
I've created 2 project folders:
www/project1/
www/project2/
My virtual hosts file looks like this:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/project1/"
ServerName project1.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/project2/"
ServerName project2.com
</VirtualHost>
Can someone advise how I can go about doing this?
您需要在 VirtualHost 中为每个主机名指定 ServerName(以及另外的 ServerAlias):
You need to specify ServerName in VirtualHost like this (and additionally ServerAlias) for each hostname: