Apache2 如何通过mod_Proxy代理多个在Tomcat中运行的应用程序

Apache2 如何通过mod_Proxy代理多个在Tomcat中运行的应用程序,apache2,tomcat6,apache,mod-proxy,Apache2,Tomcat6,Apache,Mod Proxy,我有两个在Tomcat6下运行的web应用程序。目前,我可以通过mod_proxy通过以下配置访问其中一个 <VirtualHost xxx.xxx.xxx.xxx:80> ServerAdmin email@email.com ServerName staging.domain.com ProxyPass /app1 http://localhost:8080/app1 ProxyPassReverse /app1 http://local

我有两个在Tomcat6下运行的web应用程序。目前,我可以通过mod_proxy通过以下配置访问其中一个

<VirtualHost xxx.xxx.xxx.xxx:80>
     ServerAdmin email@email.com
     ServerName staging.domain.com

     ProxyPass /app1 http://localhost:8080/app1
     ProxyPassReverse /app1 http://localhost:8080/app1
</VirtualHost>

服务器管理员email@email.com
ServerName staging.domain.com
ProxyPass/app1http://localhost:8080/app1
ProxyPassReverse/app1http://localhost:8080/app1

现在,我可以通过访问app1。我还希望能够以相同的方式访问app2:。我配置了第二个VirtualHost,但是,只有第一个可以工作。甚至可以在一个域下代理两个web应用程序吗?如果是这样的话,任何提示、技巧和窍门都将不胜感激。

啊,你已经差不多做到了:只需添加额外的ProxyPass/ProxyPassReverse语句

<VirtualHost xxx.xxx.xxx.xxx:80>
     ServerAdmin email@email.com
     ServerName staging.domain.com

     ProxyPass /app1 http://localhost:8080/app1
     ProxyPassReverse /app1 http://localhost:8080/app1

     ProxyPass /app2 http://localhost:8080/app2
     ProxyPassReverse /app2 http://localhost:8080/app2

     ProxyPass /app3 http://localhost:8080/app3
     ProxyPassReverse /app3 http://localhost:8080/app3
</VirtualHost>

服务器管理员email@email.com
ServerName staging.domain.com
ProxyPass/app1http://localhost:8080/app1
ProxyPassReverse/app1http://localhost:8080/app1
ProxyPass/app2http://localhost:8080/app2
ProxyPassReverse/app2http://localhost:8080/app2
ProxyPass/app3http://localhost:8080/app3
ProxyPassReverse/app3http://localhost:8080/app3
离我很近,我是:o) 谢谢。