wamp5下的虚拟主机的配置

1.在httpd.conf里修改

NameVirtualHost localhost:80
<VirtualHost localhost:80>
DocumentRoot “D:/wamp/www”
ServerName localhost
ServerAlias localhost
<Directory “D:/wamp/www”>
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
NameVirtualHost client.test.com:80
<VirtualHost client.test.com:80>
DocumentRoot “D:/other”
ServerName client.test.com
ServerAlias www.client.test.com
<Directory “D:/other”>
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>

 

2.修改C:/WINDOWS/system32/drivers/etc/host这个文件,用记事本打开,加上如下内容:

127.0.0.1   client.test.com

3.重启apache

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据