Apache多端口代理Tomcat应用实现

1.安装软件版本

Apache2.4下载
Apache download http://httpd.apache.org/download.cgi
以下是跟踪链接,可以直接进入对应的下载也
Files for Microsoft Windows
ApacheHaus

2.httpd.conf 配置文件修改

  • 修改以下内容

Listen 80
Listen 81
Listen 82

  • 取消以下配置

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

  • 前的注释去掉

Include conf/extra/httpd-vhosts.conf

3.httpd-vhosts.conf

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

添加如下配置

#
#DocumentRoot "${SRVROOT}/htdocs"
##ServerName auth.example.com:8080
#
NameVirtualHost *:80

ServerName auth.example.com
ServerAlias auth.example.com
ProxyRequests Off


ProxyPass / http://auth.example.com:8080/
ProxyPassReverse / http://auth.example.com:8080/

NameVirtualHost *:81

ServerName auth.example.com
ServerAlias auth.example.com
ProxyRequests Off


ProxyPass / http://auth.example.com:8081/
ProxyPassReverse / http://auth.example.com:8081/

NameVirtualHost *:82

ServerName auth.example.com
ServerAlias auth.example.com
ProxyRequests Off


ProxyPass / http://auth.example.com:8080/
ProxyPassReverse / http://auth.example.com:8080/

你可能感兴趣的:(Apache多端口代理Tomcat应用实现)