D-Klotz
D-Klotz

Reputation: 2083

If I bind tomcat 7 to a second IP address, will it use the first IP address if it needs to?

Short version: If I add a second IP address to a linux server and bind it within tomcat 7, does that stop the server from accessing anything on the first IP address network?

Long version: We have a suse linux server with a tomcat server and it will be configured to have two IP addresses. One IP address has exposure to the company user community, the other IP has access to only the private production network. The tomcat server has had it's connector changed to have address="second IP address".

The production network has other tomcat servers (not clustered and not exposed to the user community) that the primary tomcat server needs to send requests to. The question is, will the front facing tomcat server be able to send a request to anything on the "first IP address" network?


Further details:

Request comes in on "Interface 2", tomcat creates a brand new socket connection that "needs" to go through "Interface 1". The original request from "Interface 2" never goes any further. It is the tomcat server who needs to make the subsequent requests through "Interface 1". Does the tomcat connector entry "address=" preclude / stop tomcat from finding the right path for an IP address located through "Interface 1". Hope that helps to clarify the question.

Upvotes: 0

Views: 845

Answers (2)

Glenner003
Glenner003

Reputation: 1562

That should not be a problem. The tomcat binds to the user community connected ip address for it's listening socket only. Outgoing request use routing info to decide which ip address to use.

Upvotes: 1

Pete Cornell
Pete Cornell

Reputation: 235

You would need to setup Tomcat to run multiple instances. In that setup Tomcat will serve requests from both addresses. You have to make directories for each instance and setup the config files and init scripts accordingly.

We run Tomcat with 8 instances per server in our environment.

You might try this setup guide.

Upvotes: 1

Related Questions