配置虚拟目录
修改httpd.conf
1.增加模块
<IfModule dir_module>
DirectoryIndex index.php index.html index.htm
Alias /www "D:/www"
<Directory D:/www>
Order allow,deny
Allow from all
</Directory>
</IfModule>
2.注释DocumentRoot "C:/AppServ/www"
3.重启apache
配置虚拟主机
修改httpd.conf
1.启用 虚拟主机 Include conf/extra/httpd-vhosts.conf
2.打开 extra/httpd-vhosts.conf 增加虚拟模块
<VirtualHost 127.0.0.1:80>
DocumentRoot "D:/www"
DirectoryIndex index.php index.html index.htm
<Directory />
options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
3.修改hosts
127.0.0.1 www.xxx.com
4.重启apache