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#