How to run multiple applications on single jetty instance
As it will be apparent in some moments am more than a novice in jetty and tomcat. The job in hand is to run multiple applications in single jetty server and to change the url of SOLR home page something like localhost:8989/solr/node1 and localhost:8989/solr/node2. I have gone through the solutions at stackoverflow and also at http://wiki.apache.org/solr/SolrJetty but as I开发者_如何学Python am handling jetty for the first time I am not aquaited with the jargons. I will be very obliged if somebody can give me a stepwise process,including what and where to change. Thanks a lot.
Check contexts
directory under Jetty Home.
You should add a new xml file for each application.
Something like:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">solr/node2</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/node2.war</Set>
<Set name="extractWAR">true</Set>
</Configure>
For more information check http://wiki.eclipse.org/Jetty/Howto/Deploy_Web_Applications , http://docs.codehaus.org/display/JETTY/ContextDeployer , http://www.enavigo.com/2008/08/29/deploying-a-web-application-to-jetty/
If you want to run jetty in embedded way then you just need to place an xml file for each context at the place where your war/web application is present. In case you are not running jetty in embedded way then below link is useful. How can I map multiple contexts to the same war file in Jetty?
精彩评论