Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I just want to configure jetty to listen to more than one port. I don't want multiple instances nor multiple webapps, just one jetty, one webapp, but listening to 2 or more ports.

The default way does not support multiple entries:

<Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>

Thank you for your help!

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

In your jetty.xml you have something like this

<Call name="addConnector">
  <Arg>
      <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
        <Set name="host"><Property name="jetty.host" default="x.y.z.v"/></Set>
        <Set name="port"><Property name="jetty.port" default="80"/></Set>
        <Set name="maxIdleTime">300000</Set>
        <Set name="Acceptors">2</Set>
        <Set name="statsOn">false</Set>
        <Set name="confidentialPort">8443</Set>
        <Set name="lowResourcesConnections">20000</Set>
        <Set name="lowResourcesMaxIdleTime">5000</Set>
      </New>
  </Arg>
</Call>

Just duplicate this block and change the port in the duplicate.

share|improve this answer
    
That was my first approach, however, something didn't work. Now I tried it again, without problems. Thanks! –  Mario Bertschler Aug 2 '11 at 6:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.