我已经在Windows 8 PC上安装了最新版本的WAMP-我似乎无法使多个虚拟主机正常工作,我加载的每个本地URL都会显示WAMP主页。
谁能解释我在做什么错?
// My hosts file
127.0.0.1 localhost
127.0.0.1 client1.localhost
127.0.0.1 client2.localhost
我在WAMP目录中有两个文件夹,“ client1”和“ client2”,显然每个文件夹都与上面主机文件中的client1和client2相关。
// My virtual hosts file
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:\wamp\www"
</VirtualHost>
<VirtualHost *:80>
ServerName client1.localhost
DocumentRoot "C:\wamp\www\client1"
<Directory "C:\wamp\www\client1">
allow from all
order allow,deny
AllowOverride All
</Directory>
DirectoryIndex index.html index.php
</VirtualHost>
<VirtualHost *:80>
ServerName client2.localhost
DocumentRoot "C:\wamp\www\client2"
<Directory "C:\wamp\www\client2">
allow from all
order allow,deny
AllowOverride All
</Directory>
DirectoryIndex index.html index.php
</VirtualHost>
我遵循了本指南,效果很好
我不得不改变道路...
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "c:\wamp\www\client1"
ServerName client1.localhost
ErrorLog "logs/client1.log"
CustomLog "logs/client1-access.log" common
</VirtualHost>
除此之外。.我发现这是使用WAMP的虚拟主机的快速指南,http://www.techrepublic.com/blog/smb-technologist/create-virtual-hosts-in-a-wamp-server/#
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句