Wiki source code of Jetty Installation
Version 12.3 by Vincent Massol on 2021/02/19
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | There are several ways to run XWiki on Jetty: | ||
2 | * Using the [[Demo packaging (a.k.a Standalone packaging)>>Documentation.AdminGuide.Installation.InstallationStandalone.WebHome]] which bundles Jetty and provide an all-in-one zip, ready to use. | ||
3 | * Using the official [[Jetty docker image>>https://hub.docker.com/_/jetty]]. | ||
4 | * [[Downloading and instaling>>https://www.eclipse.org/jetty/download.html]] Jetty manually on your server. | ||
5 | |||
6 | If you go with the last 2 options, make sure to: | ||
7 | * Pick a [[supported version of Jetty>>dev:Community.SupportStrategy.ServletContainerSupportStrategy.WebHome]]. | ||
8 | * Follow the Jetty setup defined in the {{scm path="xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/xwiki.mod"}}##xwiki.mod##{{/scm}} file used for the demo packaging. Note that the default setup used in the Jetty Docker image should work fine out of the box. | ||
9 | * If you're deploying XWiki on a Jetty 10+, you'll need to edit the ##WEB-INF/jetty-web.xml## file since it currently contains a setup valid for Jetty 9.x and it'll fail in Jetty 10+. You'll need to remove the calls to ##prependSystemClass## and ##prependServerClass##. For example (best is to edit your version so that you can get the latest changes in it):((( | ||
10 | {{code language="xml"}} | ||
11 | <?xml version="1.0" encoding="UTF-8"?> | ||
12 | <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_0.dtd"> | ||
13 | <Configure class="org.eclipse.jetty.webapp.WebAppContext"> | ||
14 | <Set name="maxFormContentSize">1000000</Set> | ||
15 | <Set name="maxFormKeys">2000</Set> | ||
16 | </Configure> | ||
17 | {{/code}} | ||
18 | ))) | ||
19 | |||
20 | = Docker = | ||
21 | |||
22 | * Extract the [[XWiki WAR>>xwiki:Main.Download]] into a directory named ##xwiki##. Let's call this directory ##[XWIKI_HOME]##. | ||
23 | * Run the Jetty Docker image, for example: {{code language="none"}}docker run -v [XWIKI_HOME]:/var/lib/jetty/webapps/xwiki -p 8080:8080 jetty:9-jre11{{/code}} | ||
24 | |||
25 | = Manual = | ||
26 | |||
27 | * Download and install [[Jetty>>https://www.eclipse.org/jetty/download.html]]. It's usually as simple as unzipping it in a directory. Let's call this directory ##[JETTY_HOME]##. | ||
28 | * Extract the [[XWiki WAR>>xwiki:Main.Download]] into a directory named ##xwiki## in ##[JETTY_HOME]/webapps/##. | ||
29 | * Open ##[JETTY_HOME]/webapps/xwiki/WEB-INF/xwiki.properties## files and [[configure a permanent directory>>platform:AdminGuide.Configuration||anchor="HConfiguringDirectories"]] | ||
30 | * (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 {{code language="none"}}jetty.http.port{{/code}}. | ||
31 | |||
32 | = Troubleshooting = | ||
33 | |||
34 | == Unable to parse form content == | ||
35 | |||
36 | In some cases you could obtain one of the following error messages: ##Unable to parse form content##. | ||
37 | |||
38 | More specifically: ##org.eclipse.jetty.http.BadMessageException: 400: Unable to parse form content##. | ||
39 | |||
40 | 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>>https://www.eclipse.org/jetty/documentation/9.4.x/configuring-form-size.html#_configuring_form_limits_for_the_server]]. |