1: 打开虚拟主机配置,打开D:\phpStudy\Apache\conf下的 httpd.conf文件去掉#Include conf/extra/httpd-vhosts.conf前面的#保存即可。在D:\WWW目录下建立web应用例如 classmath。
2: 打开D:\phpStudy\Apache\conf\extra下的httpd-vhosts.conf文件 删除该文件中的所有内容
<VirtualHost *:80>
DocumentRoot "D:\WWW\classmath"
ServerName web.classmath.com
</VirtualHost>
<Directory "D:\WWW\classmath">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "D:\WWW" #WWW.文件夹位置
ServerName localhost
ServerAlias localhost
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>