Skip to content
Doug Hagan edited this page Nov 6, 2017 · 15 revisions

Jetty is used as a web server for the MeTL Lift application. When developing locally it is run embedded, but on the AWS instances it hosts deployed WARs.

Migrating Jetty 9.3 to 9.4

  • Backup the server (snapshot to an AMI).
  • Download the Jetty zip (eg 9.4.6.v20170531 from Jetty download page).

Jetty runs from /srv/jetty. This is a symlink to /srv/jetty-distribution-9.3.<version>.

  • Unzip the Jetty zip to a parallel directory in /srv for the new distribution (eg /srv/jetty-distribution-9.4.<version>). Don't update the symlink yet.
  • Copy from the old jetty dir to the new one:
    • apps holds the WAR as well as the release script for downloading new versions from S3
    • appConf holds the application config
    • webApps holds context.xml that directs Jetty to the WAR in apps
    • etc holds Jetty configuration. Rename the existing (new) etc directory to etc-original first.
  • Create in the new jetty dir:
    • ssl is a symlink to ../ssl
    • tmp holds temporary files.
  • Copy etc-original/console-capture.xml to etc. Remove obsolete jetty-logging.xml.
  • Copy etc-original/jetty-webapp.xml to etc.
  • Change the ownership of all files recursively with chown metl:metl -R *
  • Add to the bottom of start.ini:
# ------------- Stackable Custom -----------------------

jetty.httpConfig.securePort=443
#jetty.secure.port=443

--module=console-capture
--module=requestlog

--module=ssl

jetty.ssl.port=443
#ssl.port=443

jetty.sslContext.keyStorePath=ssl/metl.jks
jetty.sslContext.keyStorePassword=helpme
jetty.sslContext.keyStoreType=JKS
jetty.sslContext.keyManagerPassword=helpme
jetty.sslContext.trustStorePath=ssl/metl.jks
jetty.sslContext.trustStorePassword=helpme
jetty.sslContext.trustStoreType=helpme

--module=https
--module=setuid

jetty.setuid.userName=metl
jetty.setuid.groupName=metl

# TLS configuration
-Dhttps.protocols="TLSv1,TLSv1.1,TLSv1.2"
-Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2"
-Djdk.tls.ephemeralDHKeySize=2048
  • Use the new Jetty version:
> /etc/init.d/jetty stop
> rm /srv/jetty
> ln -s /srv/jetty-distribution-9.4.<version> /srv/jetty
> /etc/init.d/jetty start

Reference: Jetty upgrade notes

Clone this wiki locally