0

I have a server JAR that is deployed once per customer, it is the API server for their software package. To that end, the port for each API instance must be the same, so that anything programmed against it can always find it. Each instance is deployed on a different domain name

The problem I'm having is that, even when using a SelectChannelConnector and setting the host property, I can't get two instances to run simultaneously, I get a BindException with "Address already in use".

I suppose my question is: can Jetty do this, or do I need to do some external re-writing, or is there a better way I can go about achieving the same ends?

Thanks.

Martin
  • 55
  • 9
  • Are you running the API server code for several customers on a single machine of yours? Are you testing or hosting it? – Allen Jul 04 '10 at 16:17

2 Answers2

0

Assuming that I understand what you are trying to do, it seems the easiest way is to front your jetty instances with apache. Set apache up with virtual hosts and the appropriate configuration to send each virtual host's requests to the appropriate jetty instance.

Allen
  • 1,315
  • 7
  • 12
  • Thanks Allen, this is roughly what I did, but I used Jetty instead, and each API instance tells the Jetty proxy server which port to find it on, and the Jetty proxy forwards the request appropriately. – Martin Jul 05 '10 at 12:05
0

A bit late maybe but, it this what you're looking for? You'll configure a single connector (because you're listening on a single port) but let it answer for different domain names, and then you configure each webapp to answer to only a single domain. You can even make them have the same context path, so the only thing you change in your client code is the domain name.