Wiki source code of Configure Jetty
Last modified by Eleni Cojocariu on 2026/11/25 14:43
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | To install and configure Jetty as your [[servlet container>>doc:documentation.xs.admin.installation.servlet-container.WebHome]] for XWiki: | ||
| 2 | |||
| 3 | 1. Download a [[supported version of Jetty>>dev:Community.SupportStrategy.ServletContainerSupportStrategy.WebHome]] from the [[Jetty download page>>https://jetty.org/download.html]]. | ||
| 4 | 1. Extract Jetty to a directory of your choice. The directory that directly contains ##start.jar## is referred to as ##JETTY_HOME##. | ||
| 5 | 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##.((( | ||
| 6 | {{code language="none"}} | ||
| 7 | mkdir /path/to/jetty-base | ||
| 8 | {{/code}} | ||
| 9 | ))) | ||
| 10 | 1. ((( | ||
| 11 | Enable the deploy module matching your XWiki version and the ##http## module. Open a terminal, navigate to ##JETTY_BASE##, and run: | ||
| 12 | |||
| 13 | ((( | ||
| 14 | {{code language="none"}} | ||
| 15 | java -jar <JETTY_HOME>/start.jar --add-modules=http,<deploy-module> | ||
| 16 | {{/code}} | ||
| 17 | ))) | ||
| 18 | |||
| 19 | Replace ##<deploy-module>## with the correct module based on your XWiki version: | ||
| 20 | |||
| 21 | ((( | ||
| 22 | * XWiki 17.x and above (jakarta): ##ee10-deploy## | ||
| 23 | * XWiki 16.x and below (javax): ##ee8-deploy## | ||
| 24 | ))) | ||
| 25 | |||
| 26 | This command creates ##JETTY_BASE/webapps/## and the necessary configuration files in ##JETTY_BASE/start.d/##. | ||
| 27 | ))) | ||
| 28 | 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:((( | ||
| 29 | {{code language="none"}} | ||
| 30 | jetty.httpConfig.uriCompliance=RFC3986 | ||
| 31 | {{/code}} | ||
| 32 | ))) | ||
| 33 | 1. [[Download the XWiki WAR file>>xwiki:Download.WebHome]] for the version you need. | ||
| 34 | 1. Extract or copy the XWiki WAR file into a directory named ##xwiki## inside ##JETTY_BASE/webapps/##. | ||
| 35 | 1. [[Configure a relational database>>doc:documentation.xs.admin.installation.database.WebHome]], since XWiki initializes and attempts to connect to the database as soon as Jetty deploys the ##webapp##. | ||
| 36 | 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/##. | ||
| 37 | 1. Open ##JETTY_BASE/webapps/xwiki/WEB-INF/xwiki.properties## and set the permanent directory path:((( | ||
| 38 | {{code language="none"}} | ||
| 39 | environment.permanentDirectory=/var/lib/xwiki/data | ||
| 40 | {{/code}} | ||
| 41 | ))) | ||
| 42 | 1. Start Jetty from the ##JETTY_BASE## directory:((( | ||
| 43 | {{code language="none"}} | ||
| 44 | java -jar <JETTY_HOME>/start.jar | ||
| 45 | {{/code}} | ||
| 46 | ))) | ||
| 47 | 1. Open {{code language="none"}}http://localhost:8080/xwiki/bin/view/Main/{{/code}} in a browser. XWiki starts and serves its Home page. |