Jetty 9 Actual Installation/operation/deployment

Source: Internet
Author: User

1. First download the latest jetty from Jetty's official website http://download.eclipse.org/jetty/, download the corresponding jetty according to the JDK version, I chose the jetty-distribution-9.2.14.v20151106 version here.

2. Unzip the package to the specified directory, I unzip to the E:/jetty directory

3. Try to start the service

Jetty Boot is different from Tomcat, we know that there is a startup.bat file in the bin directory of Tomcat and we just double-click it and Tomcat starts. However, the Jetty Bin directory does not have such a boot file. So how do we start? Run the cmd command into the DOS environment

    1. Then run "Java-jar Start.jar" and you can start jetty server.

    2. Open the browser, visit http://127.0.0.1:8080, you can see the Jetty Welcome page.

4. Introduction to the jetty directory, like the Tomcat container, we also need to know what each directory does

Directory

Description

Bin

Jetty command, you can configure jetty as a system service

Ect

Jetty Self-configuration files

Lib

Jar file for Jetty

Logs

Jetty log files at runtime

WebApps

For web apps, jetty will automatically load all Web apps in this directory

Start.jar

The startup file for the jetty. Start jetty with Java-jar Start.jar in the command line environment

5. About the configuration instructions "a little bit of effort"

    1. Through the above directory we already know that all the configuration files are placed into the E:/JETTY/ETC directory
    2. Through the E:/jetty/etc/jetty-webapps.xml file, you can see that all Web apps are placed in the E:/jetty/webapps directory by default in jetty; ( note : The 9.x version is {jetty_ Home}/etc/webdefault.xml), did not modify the contents of this area too much.
    3. We can modify the port number of the jetty like Tomcat, the earlier version is modified in Jetty.xml, but the Jetty9 port modification is to modify the Start.ini file under the root directory

Modify the Start.ini file
jetty.port=8001 position on line 105th

by command mode:
Java-jar Start.jar jetty.port=8081

6. Questions relating to access

http://127.0.0.1:8080, this time note, probably nothing after the visit, before the 9.1 version of jetty in the default release of WebApps is the demo, but after 9 version is not.

Since the 9.1 release, the jetty distribution has not deployed any demo Web applications, so see more demo servers that need to run from the Demo-base directory as follows: Launch jetty Base-demo, can be launched as a jetty demo project

The browser points to http://localhost:8002 and now displays the Welcome page and several demo/test Web applications.

7. Simply try to publish your project and start Jetty,e:\jetty>java-jar Start.jar jetty.port=8002

Jetty 9 Actual Installation/operation/deployment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.