wiki:HowToRunMultipleGeonetworkInstancesUnderJetty

Version 1 (modified by justinrowles, 14 years ago) ( diff )

--

There is no getting past the fact that the public context must be the same as the local context at present.

This is how you change your local context to match whatever you want for your public one.

There are two addLifeCycle elements in jetty.xml. You will want to uncomment the one which is currently commented out, and comment out the one which isn’t. Make sure you take care of the comment lines inside the section you need to comment out.

You will need to create a contexts directory in the jetty directory.

Populate the addLifeCycle xml element and the contexts/geonetwork.xml file by following (VERY CAREFULLY!) the instructions on this page: http://docs.codehaus.org/display/JETTY/ContextDeployer

Worked example

I have two branded geonetwork installs (based on 2.6.0 and 2.6.1) running on localhost 8080 and 8081, which I want to be visible at /261/xmleditor and /260/xmleditor:

My geonetwork.xml in my geonetwork.2.6.1 install is as follows. There is a very similar(!) one in my 2.6.0 install:

<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-Mort Bay ConsultingDTD ConfigureEN" "http://jetty.mortbay.org/configure.dtd"> <Configure class="org.mortbay.jetty.webapp.WebAppContext">

<Set name="contextPath">/261/xmleditor</Set> <Set name="war"><SystemProperty name="jetty.home" default="."/>/../web/geonetwork/</Set>

</Configure>

In Apache's ProxyPass and ProxyPassReverse settings, make your localhost context the same as your public context.

ProxyPass /261/xmleditor http://localhost:8080/261/xmleditor ProxyPassReverse /261/xmleditor http://localhost:8080/261/xmleditor

ProxyPass /260/xmleditor http://localhost:8081/260/xmleditor ProxyPassReverse /260/xmleditor http://localhost:8081/260/xmleditor

I have added –Djetty.port=8080 (or 8081 for the other one) to the java line in bin/start-geonetwork.sh

I now start both processes with their respective bin/start-geonetwork.sh files, count to ten and restart httpd.

If it doesn’t all work, then read the jetty/logs/output.log and apache log for clues ;-)

Note: See TracWiki for help on using the wiki.