WAMP下配置Apache虚拟主机
首先找到三个文件
- hosts文件,所在目录C:\Windows\System32\drivers\etc\hosts
- httpd.conf文件,目录E:..\apache2.4.9\conf
- httpd-vhosts.conf文件,所在目录E:..\apache2.4.9\conf\extra
hosts文件配置
配置hosts文件使域名和所访问的IP地址映射。
访问本地,在hosts文件这样配置:127.0.0.1 localhost
在浏览器中输入localhost就可以访问到php了
比如我要在本地访问一个站点, 我给这个站点起个域名为mytest.com。那么在hosts文件就可以这样配置:127.0.0.1 mytest.com
httpd文件配置
去掉virtual hosts下面Include前的#
httpd-vhosts文件配置
<VirtualHost *:80>
ServerName mytest.com
DocumentRoot "E:/Lee/wamp/www/mytest"
<Directory "E:/Lee/wamp/www/mytest">
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
本文地址:http://blog.csdn.net/Zelena163/article/details/48830421