Apache作为Tomcat的代理的配置:
1. 注解Apache带来的模块:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
2. 写带来的配置文件:
配置文件的主要内容:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.360buyAD.local
DocumentRoot "D:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
ServerName sport.dongjiejie.com
ServerAlias www.dummy-host.360buyAD.local
ErrorLog "logs/dummy-host.360buyAD.local-error.log"
CustomLog "logs/dummy-host.360buyAD.local-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.360buyAD.local
ServerName examples.dongjiejie.com
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ErrorLog "logs/dummy-host2.360buyAD.local-error.log"
CustomLog "logs/dummy-host2.360buyAD.local-access.log" common
</VirtualHost>
将这个配置文件命名为httpd-vhost-tomcat.conf
3.Apache中添加对vhost文件的引入。重启Aapche服务。
Include conf/extra/httpd-vhosts-tomcat.conf