First, you need to install the JDK, self-solve
Download Jetty installation Package http://dist.codehaus.org/jetty/
I downloaded the 8.1.15.
TAR-XZVF *.tar.gz
After the extraction, the basic will be able to use
There are some demo war packages under WebApps
Start Jetty Service: Java-jar start.jar default port8080
Visit http://localhost:8080 and you can.
Start deploying your own war package now
Add your War pack already, name is Abc.war
Then put the war package below WebApps
Once again, start jetty.
Visit HTTP://LOCALHOST:8080/ABC to access the interview
Let's say your War pack name is very complex and you don't want to change it, but it's easy to access the path
You can copy the Test.xml under the context folder to Xxx.xml and then change the contents of the file
<?xml version= "1.0" encoding= "iso-8859-1"?><! DOCTYPE Configure Public "-//jetty//configure//en" "Http://www.eclipse.org/jetty/configure.dtd" ><!--======== ==========================================================configure and deploy the test Web application in $ ( Jetty.home)/webapps/testnote. If This file does not exist or used a context path other That/testthen the default configuration of Jetty.xml would discov Er the testwebapplication with a webappdeployer. By specifying a context in Thisdirectory, additional configuration may be specified and hot deployments detected.========= ============================================================--><configure class= " Org.eclipse.jetty.webapp.WebAppContext "> <!------------------------------------ ; <!--Required Minimal context configuration:-<!--+ ContextPath -<!--+ War OR resourcebase -<!------------------------------------> <set name= "contextpath" >/h Ello</set> <set name= "war" ><systemproperty name= "Jetty.home" default= "." />/webapps/abc-123-def-567.war</set> <!------------------------------------& Gt <!--Optional Context configuration--<!------------------- -----------------<set name= "Extractwar" >true</Set> <set name= "Copywebdir" >false< ;/set> <set name= "Defaultsdescriptor" ><systemproperty name= "Jetty.home" default= "." />/etc/webdefault.xml</set> <!--virtual hosts <set name= "Virtualhosts" > <array type= "String" & Gt <Item>www.myVirtualDomain.com</Item> <Item>localhost</Item> <item>127.0.0.1</it Em> </Array> </Set> <!--disable cookiess <get name= "Sessionhandler" > <get name= "SessionManager" > <set name= "usingcookies" type= "Boole An ">false</Set> </Get> </Get>-<!--Non standard error page mapping-<! --<get name= "ErrorHandler" > <call name= "adderrorpage" > <arg type= "int" >500</Arg> &L T ARG type= "int" >599</Arg> <arg type= "String" >/dump/errorCodeRangeMapping</Arg> </Call> </Get> <!--ADD context specific logger <set name= "handler" > <new id= "requestlog" class= "or G.eclipse.jetty.server.handler.requestloghandler "> <set name=" requestlog "><new id=" RequestLogImpl " class= "Org.eclipse.jetty.server.NCSARequestLog" > <set name= "filename" ><property name= "Jetty.logs" default= "./logs"/>/test-yyyy_mm_dd.request.log</set> <set name= "Filenamedateformat" >yyyy_MM_dd </Set> <set name= "Append" >true</set> <set name= "logtimezone" >GMT</Set></New> </Set> </New> </Set>-->< ;/configure>
At this point you can see the war package name is very complex, but the access to the path has been changed to Hello
So now once again start Jetty Service, visit Http://localhost:8080/hello can visit
At this point the installation and simple use of jetty is over!
Install jetty deployment using Linux (Redhat 5.8)