1.首先在apache的目录下找到httpd-vhosts.conf文件(E:\www\wamp\bin\apache\Apache2.2.17\conf\extra);加上下面这段
<VirtualHost *:80>
<Directory "E:/www/wamp/www/xuexiao"> //这块写上站点目录路径
Options -Indexes FollowSymLinks
Allow from all
AllowOverride All
</Directory>
ServerAdmin 875203880@qq.com
DocumentRoot "E:/www/wamp/www/xuexiao" //站点路径
ServerName webapp:80
ServerAlias www.xuexiao.com //域名命名;
ErrorLog logs/webapp-error_log
</VirtualHost>
2.在apache的配置文件中(E:\www\wamp\bin\apache\Apache2.2.17\conf\httpd.conf)搜索vhost,把注释去掉;
3.C:\WINDOWS\system32\drivers\etc\hosts
把文件域名绑定到本地 127.0.0.1 www.xuexiao.com