There is little to no reason to be editing XML files anymore with Jetty 9.
Use the Jetty 9 module system and ${jetty.base}
concepts.
$ cd /opt/jetty
$ tar -zxvf jetty-distribution-9.3.3.v20150827.tar.gz
$ mkdir my.base
$ cd my.base
$ java -jar ../jetty-distribution-9.3.3.v20150827/start.jar \
--add-to-start=http,https,deploy,webapp
INFO: server initialised (transitively) in ${jetty.base}/start.ini
INFO: http initialised in ${jetty.base}/start.ini
INFO: ssl initialised (transitively) in ${jetty.base}/start.ini
INFO: https initialised in ${jetty.base}/start.ini
INFO: webapp initialised in ${jetty.base}/start.ini
INFO: deploy initialised in ${jetty.base}/start.ini
DOWNLOAD: http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/jetty-server/src/test/config/etc/keystore?id=master to ${jetty.base}/etc/keystore
MKDIR: ${jetty.base}/webapps
INFO: Base directory was modified
$ ls -laF$ ls -laF
total 48
drwxrwxr-x. 4 joakim joakim 4096 Sep 23 06:01 ./
drwxr-xr-x. 22 joakim joakim 12288 Sep 23 06:00 ../
drwxrwxr-x. 2 joakim joakim 4096 Sep 23 06:01 etc/
-rw-rw-r--. 1 joakim joakim 5009 Sep 23 06:01 start.ini
drwxrwxr-x. 2 joakim joakim 4096 Sep 23 06:01 webapps/
At this point:
- Replace the
etc/keystore
file with your SSL keystore.
- Edit the start.ini for:
- your http port (
jetty.http.port
)
- your https port (
jetty.https.port
)
- and your various SslContext / keystore values (see keys starting with
jetty.sslContext.
)
When complete, run Jetty ..
$ cd /opt/jetty/my.base
$ java -jar ../jetty-distribution-9.3.3.v20150827/start.jar
2015-09-23 06:05:40.619:INFO::main: Logging initialized @272ms
2015-09-23 06:05:40.764:INFO:oejs.Server:main: jetty-9.3.3.v20150827
2015-09-23 06:05:40.779:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:///home/joakim/code/jetty/distros/my.base/webapps/] at interval 1
2015-09-23 06:05:40.790:INFO:oejs.ServerConnector:main: Started ServerConnector@1718d616{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
2015-09-23 06:05:40.810:INFO:oejus.SslContextFactory:main: x509=X509@7e0babb1(jetty,h=[jetty.eclipse.org],w=[]) for SslContextFactory@6debcae2(file:///home/joakim/code/jetty/distros/my.base/etc/keystore,file:///home/joakim/code/jetty/distros/my.base/etc/keystore)
2015-09-23 06:05:40.810:INFO:oejus.SslContextFactory:main: x509=X509@5ba23b66(mykey,h=[],w=[]) for SslContextFactory@6debcae2(file:///home/joakim/code/jetty/distros/my.base/etc/keystore,file:///home/joakim/code/jetty/distros/my.base/etc/keystore)
2015-09-23 06:05:41.026:INFO:oejs.ServerConnector:main: Started ServerConnector@305fd85d{SSL,[ssl, http/1.1]}{0.0.0.0:8443}
2015-09-23 06:05:41.027:INFO:oejs.Server:main: Started @680ms
Curious what your server configuration looks like? Run this...
$ cd /opt/jetty/my.base
$ java -jar ../jetty-distribution-9.3.3.v20150827/start.jar --list-config