Difference between revisions of "Jetty"

From Dogtag
Jump to: navigation, search
m (References)
m (References)
 
(2 intermediate revisions by the same user not shown)
Line 43: Line 43:
  
 
The server can be accessed at http://localhost:8080.
 
The server can be accessed at http://localhost:8080.
 +
 +
= Class Loading =
 +
 +
* [https://www.eclipse.org/jetty/documentation/9.4.x/jetty-classloading.html Jetty Classloading]
  
 
= Deploying Web Application =
 
= Deploying Web Application =
  
 
Web application can be deployed in /var/lib/jetty/webapps folder.
 
Web application can be deployed in /var/lib/jetty/webapps folder.
 +
 +
To deploy web application from outside of /var/lib/jetty/webapps,
 +
create an deployment descriptor (e.g. acme.xml) in /var/lib/jetty/webapps
 +
that points to the web application folder, e.g.:
 +
 +
<pre>
 +
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
 +
  <Set name="contextPath">/acme</Set>
 +
  <Set name="war">/usr/share/pki/acme/webapps/acme</Set>
 +
</Configure>
 +
</pre>
  
 
= Logs =
 
= Logs =
Line 64: Line 79:
 
* [https://sangupta.com/tech/rest-server-with-jetty.html Building a REST Server using Jetty]
 
* [https://sangupta.com/tech/rest-server-with-jetty.html Building a REST Server using Jetty]
 
* [[Jersey]]
 
* [[Jersey]]
 +
* [[Jetty Systemd]]

Latest revision as of 00:59, 16 August 2019

Overview

Platform Tomcat
Fedora 28 Jetty 9.4
Fedora 27 Jetty 9.4
Debian Jetty 9.2

Installation

$ dnf install jetty

Configuration

Jetty configuration is located in /etc/jetty folder:

  • jetty.xml
  • jetty-http.xml
  • jetty-https.xml

Starting Jetty

To start Jetty as an application:

$ /usr/share/jetty/bin/jetty.sh

To start Jetty as a service:

$ systemctl start jetty

To start Demo Application:

$ cd /usr/share/jetty/demo-base
$ java -jar /usr/share/jetty/start.jar

The server can be accessed at http://localhost:8080.

Class Loading

Deploying Web Application

Web application can be deployed in /var/lib/jetty/webapps folder.

To deploy web application from outside of /var/lib/jetty/webapps, create an deployment descriptor (e.g. acme.xml) in /var/lib/jetty/webapps that points to the web application folder, e.g.:

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="contextPath">/acme</Set>
  <Set name="war">/usr/share/pki/acme/webapps/acme</Set>
</Configure>

Logs

To view Jetty logs:

$ journalctl -fu jetty

References