本示例支持80,82两端口

修改conf/httpd.conf文件:

Listen 

改为

Listen
Listen
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

改为

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

修改conf/extra/httpd-vhosts.conf

<VirtualHost *:>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost> <VirtualHost *:>
DocumentRoot "D:/web"
ServerName localhost
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>

开启httpd-vhosts.conf配置文件后,xampp会报Access forbidden的错误,需要修改conf/httpd.conf文件:

<Directory />
AllowOverride none
Require all denied
</Directory>

改为:

<Directory />
AllowOverride none
#Require all denied
Order deny,allow
Allow from all
</Directory>
05-23 19:38