简体   繁体   English

Apache Webserver配置到多个apache tomcat应用程序

[英]Apache Webserver configuration to multiple apache tomcat application

I have apache tomcat application which is configured to apache webserver, now I want to add another apache tomcat application to same Apache web server,all these servers (apache tomcat and apache web server (rhel)) are on same network, kindly provide me some ways for configuring it. 我有apache tomcat应用程序配置为apache webserver,现在我想将另一个apache tomcat应用程序添加到同一个Apache web服务器,所有这些服务器(apache tomcat和apache web server(rhel))都在同一个网络上,请给我一些配置它的方法。

is there any other way without using mod_jk? 没有使用mod_jk还有其他方法吗?

Apache can talk to Tomcat using either mod_jk or by using the standard proxy module, mod_proxy . Apache可以使用mod_jk或使用标准代理模块mod_proxy与Tomcat通信。 Using the standard proxy module, it's very easy to put multiple instances of Tomcat behind a single Apache instance. 使用标准代理模块,可以很容易地将多个Tomcat实例放在单个Apache实例之后。

Assuming that you have a Tomcat instance listening on port 8080 and another on port 8081, you can do something as simple as this: 假设您有一个Tomcat实例在端口8080上侦听而另一个在端口8081上侦听,您可以做一些简单的事情:

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

<Location /app2/>
  ProxyPass http://localhost:8081/
  ProxyPassReverse http://localhost:8081/
</Location>

This places the first instance at /app1/ and the second instance at /app2/ . 这将第一个实例放在/app1/ ,第二个实例放在/app2/

The mod_proxy documentation is a good place to start, and the tomcat documentation covers this topic briefly. mod_proxy文档是一个很好的起点, tomcat文档简要介绍了这个主题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM