设置vhost文件
<VirtualHost *:80>
DocumentRoot "D:\do.com\shop"
ServerName shop.do.test #实际访问路径
ServerAlias
ProxyPass /shop/ http://localhost:8080/shop/ #代理静态资源
ProxyPassReverse /shop/ http://localhost:8080/shop/ #代理静态资源
ProxyPass / http://localhost:8080/shop/
ProxyPassReverse / http://localhost:8080/shop/
<Directory "D:\do.com\shop">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
注意 tomcat工程里面由于设置了虚拟目录/shop,访问的所有静态资源都是带虚拟目录的(如:/shop/css/main.css,所以在访问shop.do.test页面的时候,静态资源都找不到了,需要配置那段代理静态资源后才可以访问