One, jetty start

Source: Internet
Author: User

One, jetty installation

From the official website download.eclipse.org/jetty/Download the required version, in the specified directory decompression can, the following with $jetty_home to represent the jetty directory, that is, the installation directory. The version I'm using is 9.2.6.v20141205.

Two, jetty start

1,jetty.sh Script Startup

In the directory $jetty_home/bin directory there is a script file jetty.sh, enter

Jetty. SH start

You can start jetty and enter localhost:8080/in your browser to get the Jetty home page. By default it is empty and you can write a index.html file yourself and place it in the $jetty_home/webapps/root/directory.

2, start with JAR file

In the directory jettypath/directory, there is a Start.jar file, enter

CD $JETTY _home
Java-jar Start.jar

You can also start jetty.

3, start jetty from the sample app

After the Jetty9.1 version, there is no longer an example in the default configuration, and if you need to see an example from JETTY, you need to start JETTY from the $jetty_home/demo-base/directory. In the shell, enter

CD $JETTY _home/demo--jar. /start.jar

At this point, enter localhost:8080/in the browser to get a welcome to Jetty home page.

4. Create a new instance directory and start

Jetty provides a feature that allows Jetty to have a separate configuration file and application directory through a new directory.

First create a new MyBase directory to start the jetty instance

mkdir-jar. /start.jar

The execution results are as follows:

-jar Start.jar [Options] [Properties] [configs]       -jar start.jar--help for more   Information

This should be done

Java-jar. /start.jar--add-to-startd=http,deploy

After execution, the MyBase directory will appear under the START.D and WebApps two subdirectories, that is, the generation of their own jetty instance version, again through the Start.jar boot jetty. Note that at this point, the WebApps is empty and you need to create a new Web App yourself. In addition, the resulting configuration is empty, many modules are not loaded, if it is a JSP Web page, there will be an unresolved situation.

Three, change the port

Java-jar. /start.jar jetty.port=8888

If the port number is less than 1024 (excluding 1024), the command needs to be executed as an administrator.

One, jetty start

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.