Jetty Installation
Last modified by Vincent Massol on 2024/08/12
There are several ways to run XWiki on Jetty:
- Using the Demo packaging (a.k.a Standalone packaging) which bundles Jetty and provide an all-in-one zip, ready to use.
- Using the official Jetty docker image.
- Downloading and installing Jetty manually on your server.
If you go with the last 2 options, make sure to:
- Pick a supported version of Jetty.
- Follow the Jetty setup defined in the xwiki.mod file used for the demo packaging. Note that the default setup used in the Jetty Docker image should work fine out of the box.
- Jetty has introduced a URI Compliance configuration (since 10.0.3+) which, for example, forbids having encoded % characters (encoded as %25%) in URL paths. However XWiki uses these and thus you need to tell Jetty to simply follow the URL RFCs without adding these extra checks. This can be done in several ways:
- By editing server.ini and adding the line: jetty.httpConfig.uriCompliance=RFC3986
- If you're using the Jetty Docker image, by passing jetty.httpConfig.uriCompliance=RFC3986 on the docker run command line: docker run ... jetty jetty.httpConfig.uriCompliance=RFC3986.
Docker
- Extract the XWiki WAR into a directory named xwiki. Let's call this directory [XWIKI_HOME].
- Setup a permanent directory on your local machine and let's call it [XWIKI_PERMDIR]
- Run the Jetty Docker image, for example: docker run -v [XWIKI_HOME]:/var/lib/jetty/webapps/xwiki -v [XWIKI_PERMDIR]:/var/lib/jetty/xwiki-data -p 8080:8080 jetty:9-jre11 -Dxwiki.data.dir=/var/lib/jetty/xwiki-data
- Note that you won't need the -Dxwiki.data.dir=/var/lib/jetty/xwiki-data part if you have edited [XWIKI_HOME]/WEB-INF/xwiki.properties and set the environment.permanentDirectory to point to /var/lib/jetty/xwiki-data. The system property just overrides whatever is defined in environment.permanentDirectory.
- Also note that you'll need a database set up too. If you want to quickly test it, you can simply copy the the HSQLDB JAR into WEB-INF/lib.
- If you're using Jetty 12+, you'll need to specify what environment to execute in: docker run ... jetty:12 --module=ee8-webapp,ee8-deploy,ee8-jstl
Manual
- Download and install Jetty. It's usually as simple as unzipping it in a directory. Let's call this directory [JETTY_HOME].
- Extract the XWiki WAR into a directory named xwiki in [JETTY_HOME]/webapps/.
- Open [JETTY_HOME]/webapps/xwiki/WEB-INF/xwiki.properties files and configure a permanent directory
- (Optional) If you want to modify the port on which Jetty will run, edit [JETTY_HOME]/start.ini. Search for 8080, replace it with the port value you wish to use and uncomment the corresponding property jetty.http.port.
Troubleshooting
Unable to parse form content
In some cases you could obtain one of the following error messages: Unable to parse form content.
More specifically: org.eclipse.jetty.http.BadMessageException: 400: Unable to parse form content.
This can be related to a form containing too many parameters. In order to fix this issue, you can modify your jetty.xml file as explained in Configuring form limits for the server.