Reputation: 11
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.
is there any other way without using mod_jk?
Upvotes: 1
Views: 1738
Reputation: 311606
Apache can talk to Tomcat using either mod_jk
or by using the standard proxy module, mod_proxy
. Using the standard proxy module, it's very easy to put multiple instances of Tomcat behind a single Apache instance.
Assuming that you have a Tomcat instance listening on port 8080 and another on port 8081, you can do something as simple as this:
<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/
.
The mod_proxy documentation is a good place to start, and the tomcat documentation covers this topic briefly.
Upvotes: 3