Apache多端口代理Tomcat应用实现

安装软件版本 Apache2.4下载Apache download 以下是跟踪链接,可以直接进入对应的下载也 Files for Microsoft WindowsApacheHaus

2.httpd.conf 配置文件修改

修改以下内容Listen 80Listen 81Listen 82取消以下配置LoadModule proxy_module modules/mod_proxy.soLoadModule proxy_http_module modules/mod_proxy_http.so前的注释去掉Include conf/extra/httpd-vhosts.conf

3.httpd-vhosts.conf

路径:\conf\extra\httpd-vhosts.conf

添加如下配置

#<VirtualHost _default_:80>#DocumentRoot "${SRVROOT}/htdocs"##ServerName :8080#</VirtualHost>NameVirtualHost *:80<VirtualHost *:80>ServerName ServerAlias ProxyRequests Off<Proxy *> </Proxy>ProxyPass / :8080/ProxyPassReverse / :8080/</VirtualHost>NameVirtualHost *:81<VirtualHost *:81>ServerName ServerAlias ProxyRequests Off<Proxy *> </Proxy>ProxyPass / :8081/ProxyPassReverse / :8081/</VirtualHost>NameVirtualHost *:82<VirtualHost *:82>ServerName ServerAlias ProxyRequests Off<Proxy *> </Proxy>ProxyPass / :8080/ProxyPassReverse / :8080/</VirtualHost>