Jetty provides a Web server and Javax.servlet container that adds support for 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 used in a wide range of projects and products and can be used in both development and production environments. Jetty can be easily embedded into devices, tools, frameworks, application servers, and clusters. For more use, see the Jetty Web page. Install jetty on Ubuntu 14.10 Server 9
Su doapt-get install openjdk-8-jdk
Java will be installed to/usr/lib/jvm/java-8-openjdk-i386, and a symbolic link named java-8-openjdk-i386 will be created under this directory, and a symbolic link can be created under/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
$tar-XVF jetty-distribution-9.2.5.v20141112.tar.gz
This will extract it to jetty-distribution-9.2.5.v20141112, and you will need to move the archive to/opt/jetty using the following command:
$MV Jetty-distribution-9.2.5.v20141112/opt/jetty
You need to create a jetty user and set it as the owner of the/opt/jetty directory
Su douseradd jetty-u-s/bin/falsesudo chown-r jetty:jetty/opt/jetty
Use the following command to copy the jetty script to the startup directory so that it runs as a service
$ cp/opt/jetty/bin/jetty.sh/etc/init.d/jetty
Now you need to use the following to create the jetty settings file
Su dovi/etc/default/jetty
Add the following line
Java_home=/usr/bin/javajetty_home=/opt/jettyno_start=0jetty_args=jetty.port= 8085jetty_host=0.0. 0.0jetty_user=JETTY
Save and exit the file
You need to use the following command to start the jetty service
Sustart
You should see output similar to the following
Nov:GMT
If you see the following error
* * Error:jetty_home not set, u need to set it or install in a standard location you need to make sure that the correct JETTY home is set in the/etc/default/jetty file You can use the following URL to test the 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 Use the following command to verify and check the configuration
Sucheck
Use the following command to let jetty start automatically after a restart
Suupdate-rc.d Jetty Defaults
Restart the server and test whether the jetty starts automatically.
To check which port the jetty is running on, or if the port is conflicting with another program, you can run Netstat-tln
- This article is from: Linux Tutorial Network
Installing Jetty on Ubuntu 14.10 Server