Install Jetty9 on Ubuntu14.10Server (Java service engine and Web server)

Source: Internet
Author: User
Jetty provides a Web server and a javax. servlet container to support SPDY, WebSocket, OSGi, JMX, JNDI, JAAS, and many other integration suites. These components are open-source and can be used for commercial purposes and distribution. Jetty is widely used in a variety of projects and products and can be used in development and production environments. Jetty can be easily embedded into devices, tools, frameworks, application servers, and clusters. For more information, see the Jetty webpage. Jett

Jetty provides a Web server and a javax. servlet container to support SPDY, WebSocket, OSGi, JMX, JNDI, JAAS, and many other integration suites. These components are open-source and can be used for commercial purposes and distribution.

Jetty is widely used in a variety of projects and products and can be used in development and production environments. Jetty can be easily embedded into devices, tools, frameworks, application servers, and clusters. For more information, see the Jetty webpage.

Jetty features
  • Full functionality and standards-based
  • Open-source and commercial license
  • Flexible and scalable
  • Small footprint
  • Embedded
  • Asynchronous support
  • Enterprise elastic Scaling
  • Apache and Eclipse dual license
Prerequisites for installing Jetty 9 on Ubuntu 14.10 server

Before installing the Jetty server, run the following command to install Java

  1. Sudo apt-get install openjdk-8-jdk

Java will install to/usr/lib/jvm/java-8-openjdk-i386, and a symbolic link named java-8-openjdk-i386 will be created under this directory, A symbolic link is also created in/usr/bin/java.

Now you need to download Jetty9 from here. After the download is complete, you need to use the following command to decompress

  1. $ Tar-xvf jetty-distribution-9.2.5.v20141112.tar.gz

This operation will decompress it to the jetty-distribution-9.2.5.v20141112, and you need to use the following command to move the archive file to/opt/jetty

  1. $ Mv jetty-distribution-9.2.5.v20141112/opt/jetty

Create a jetty user and set it to the owner of the/opt/jetty directory.

  1. Sudo useradd jetty-U-s/bin/false
  2. Sudo chown-R jetty: jetty/opt/jetty

Run the following command to copy the Jetty script to the startup directory to run it as a service.

  1. $ Cp/opt/jetty/bin/jetty. sh/etc/init. d/jetty

Now, you need to use the following content to create the Jetty setting file.

  1. Sudo vi/etc/default/jetty

Add the following lines

  1. JAVA_HOME =/usr/bin/java
  2. JETTY_HOME =/opt/jetty
  3. NO_START = 0
  4. JETTY_ARGS = jetty. port = 8085.
  5. JETTY_HOST = 0.0.0.0
  6. JETTY_USER = jetty

Save and exit the file

Run the following command to start the Jetty service:

  1. Sudo service jetty start

You should see the output similar to the following

  1. StartingJetty: OK MonNov2411: 55: 48 GMT 2014

If you see the following error

** ERROR: JETTY_HOME not set, you need to set it or install in a standard location

Make sure that the correct jetty home directory path is set in the/etc/default/Jetty file. You can use the following URL to test jetty.

Jetty should now run on port 8085, open the browser and access http: // server IP: 8085, you should be able to see the Jetty screen.

Jetty service check

Run the following command to verify and check the Configuration:

  1. Sudo service jetty check

Run the following command to enable automatic start of Jetty upon restart

  1. Sudo update-rc.d jetty defaults

Restart the server and test whether Jetty is automatically started.

To check which Port Jetty runs on or whether the port conflicts with other programs, run netstat-tln.

Use Jetty as an Embedded Server http://www.linuxidc.com/Linux/2013-07/86983.htm

Jetty source code analysis http://www.linuxidc.com/Linux/2013-10/90986.htm

Jetty install learn and present http://www.linuxidc.com/Linux/2014-05/101993.htm

Jetty installation http://www.linuxidc.com/Linux/2013-10/90991.htm in Eclipse

Install Jetty deployment using http://www.linuxidc.com/Linux/2014-10/108342.htm in Linux (RedHat 5.8)

Jetty details: Click here
Jetty's: Click here

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-01/112441.htm

Related Article

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.