1

HP Operations Orchestration 9.07 (now near EOL) runs in a Jetty 6.1.14 webapp on port 8443.

How can I get Jetty 6.1.14 to run a separate, basic web/file server on port 80?

What I have done so far in the jetty.xml config file has been unsuccessful:

<Configure id="FileServer" class="org.mortbay.jetty.Server">
    <Call name="addConnector">
      <Arg>
          <New class="org.mortbay.jetty.nio.SelectChannelConnector">
            <Set name="port">80</Set>
          </New>
      </Arg>
    </Call>

    <Set name="handler">
      <New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
        <Set name="handlers">
          <Array type="org.mortbay.jetty.ResourceHandler">
            <Item>
              <New id="Contexts" class="org.mortbay.jetty.handler.ResourceHandler"/>
            <Set name="directoriesListed">true</Set>
        <Set name="welcomeFiles">
          <Array type="String"><Item>index.html</Item></Array>
        </Set>
            <Set name="resourceBase">.</Set>
          </New>
            </Item>
<Item>
<New class="org.mortbay.jetty.server.handler.DefaultHandler"></New>
</Item>
          </Array>
        </Set>
      </New>
    </Set>

    <Call name="addLifeCycle">
      <Arg>
        <New class="org.mortbay.jetty.deployer.WebAppDeployer">
          <Set name="contexts"><Ref id="Contexts"/></Set>
          <Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/webapps</Set>
        </New>
      </Arg>
    </Call>
</Configure>

This has come from a combination of courses, including https://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty#Configuring_a_File_Server_with_XML

0
1

That version of Jetty is over 6 years old, and Jetty 6 itself has been EOL for over 4 years. We are releasing milestone versions of Jetty 9.3.x now which contain HTTP/2 support.

Referencing the Jetty 7/8 documentation will be difficult since we migrated over to the Eclipse foundation between 6 and 7 so all of the packaging changed, not to mention how the modules themselves were sliced up. Jetty 6 documentation can still be found here:

http://docs.codehaus.org/display/JETTY/Jetty+Documentation

This is the section you would want to look at:

http://docs.codehaus.org/display/JETTY/Static+Content

Basically, you need to register either a DefaultServlet to serve the static content, or wire up a ResourceHandler to do the same. Both will require you to set up a context to serve the static content from.

1
  • I know it's very old - like I said, it's used by HP OO 9.x (which is nearing its EOL, too): and I'm trying to avoid needing to spin-up a second webserver alongside Jetty to serve on port 80 on the same server – warren Dec 19 '14 at 15:14
0

Based on help received in a Google+ community regarding this question, it is not possible in Jetty 6.1.14.

directoriesListed option did not exist in Jetty6.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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