Wiki source code of Configure Jetty

Last modified by superadmin on 2026/11/25 21:30

Show last authors
1 1. Download a [[supported version of Jetty>>dev:Community.SupportStrategy.ServletContainerSupportStrategy.WebHome]] from the [[Jetty download page>>https://jetty.org/download.html]], to serve as XWiki's [[servlet container>>doc:documentation.xs.admin.installation.deploy-servlet-container.WebHome]].
2 1. Extract Jetty to a directory of your choice. The directory that directly contains ##start.jar## is referred to as ##JETTY_HOME##.
3 1. Create a separate directory for your configuration and [[web applications>>https://jetty.org/docs/jetty/12.1/operations-guide/deploy/index.html]], referred to as ##JETTY_BASE##. This must be a different directory from ##JETTY_HOME## - never modify files inside ##JETTY_HOME##.(((
4 {{code language="none"}}
5 mkdir /path/to/jetty-base
6 {{/code}}
7 )))
8 1. (((
9 Enable the deploy module matching your XWiki version and the ##http## module. Open a terminal, navigate to ##JETTY_BASE##, and run:
10
11 (((
12 {{code language="none"}}
13 java -jar <JETTY_HOME>/start.jar --add-modules=http,<deploy-module>
14 {{/code}}
15 )))
16
17 Replace ##<deploy-module>## with the correct module based on your XWiki version:
18
19 (((
20 * XWiki 17.x and above (jakarta): ##ee10-deploy##
21 * XWiki 16.x and below (javax): ##ee8-deploy##
22 )))
23
24 This command creates ##JETTY_BASE/webapps/## and the necessary configuration files in ##JETTY_BASE/start.d/##.
25 )))
26 1. Configure [[URI Compliance>>https://jetty.org/docs/jetty/12.1/operations-guide/modules/standard.html]]. Jetty forbids encoded ##%## characters (written ##%25##) in URL paths, but XWiki uses them. Open ##JETTY_BASE/start.d/http.ini## and add the line:(((
27 {{code language="none"}}
28 jetty.httpConfig.uriCompliance=RFC3986
29 {{/code}}
30 )))
31 1. [[Download the XWiki WAR file>>xwiki:Download.WebHome]] for the version you need.
32 1. Extract or copy the XWiki WAR file into a directory named ##xwiki## inside ##JETTY_BASE/webapps/##.
33 1. [[Configure a relational database>>doc:documentation.xs.admin.installation.install-relational-database.WebHome]], since XWiki initializes and attempts to connect to the database as soon as Jetty deploys the ##webapp##.
34 1. Create a directory to store XWiki's [[permanent data>>documentation.xs.admin.installation.directories.permanent-directory.WebHome]] (attachments, configurations, extensions), e.g., ##/var/lib/xwiki/data##. Use an absolute path outside of ##JETTY_BASE/webapps/##.
35 1. Open ##JETTY_BASE/webapps/xwiki/WEB-INF/xwiki.properties## and set the permanent directory path:(((
36 {{code language="none"}}
37 environment.permanentDirectory=/var/lib/xwiki/data
38 {{/code}}
39 )))
40 1. Start Jetty from the ##JETTY_BASE## directory:(((
41 {{code language="none"}}
42 java -jar <JETTY_HOME>/start.jar
43 {{/code}}
44 )))
45 1. Open {{code language="none"}}http://localhost:8080/xwiki/bin/view/Main/{{/code}} in a browser. XWiki starts and serves its Home page.

Get Connected