Tomcat Installation

Last modified by Eleni Cojocariu on 2026/05/28 16:23

Warning

Documentation is being refactored at: Configure Tomcat.

Installation Steps

See Configure Tomcat.

Activate headless mode

See Headless Mode Activation on Apache Tomcat.

Optional configuration

See Enable HTTP Compression (gzip)

Policy configuration

See Java Security Manager in Tomcat.

HTTP reverse proxy

For a variety of reasons, it is not ideal to allow users to connect directly to tomcat. So it's generally recommended to put an HTTP reverse proxy such as Apache HTTP Server or Nginx in front of it.

Using Apache HTTP Server

See Apache Server Key Configurations and the tutorials:

Using Nginx

See NginX Server Key Configurations and the tutorial to Set up NginX Proxy Server.

Http (unsecure)

 
See Set up NginX Proxy Server.

Https (secure)

See More Configurations for the NginX HTTP Proxy Server.
See Configure Tomcat to Find Proxy Headers.

Proxying and tunnels

See Reverse Proxy and SSH Tunneling.

Recommendations

Default encoding

See Configure Tomcat.

Troubleshooting

Out Of Memory Error

General Memory Settings

See Configure Java Memory for Tomcat

Max number of threads

See "Unable to Create Native Thread" Errors on Debian Systems.

Java Security Manager

See Java Security Manager in Tomcat

Allowing "/" and "\" in page names

See Configure Tomcat to Allow Slash and Backslash in Page Names.

Apache front-end server

Note that if you're using the Apache web server as a front-end, you also need to configure Apache to allow encoded / and \ (AllowEncodedSlashes NoDecode) and also make sure to use nocanon on the ProxyPass line used.

NotSerializableException

See Session Deserialization Errors in Tomcat

SEVERE: Error listenerStart

See "Severe: Error listenerStart" in Logs.

Parameter count exceeded allowed maximum

See Parameter Count Exceeded Allowed Maximum.

ThreadLocal Errors

See ThreadLocal Memory Leak Warnings on Shutdown.

Request header is too large

See Request Header is Too Large.

Old Instructions

Note that Tomat 7 is no longer supported.

Error

The Tomcat project has brought a change in the way they handle RequestDispatcher which has caused regressions in XWiki for some versions of Tomcat. Thus you should not use the following Tomcat versions:

  • >= 9.0.0.M5 and < 9.0.0.M10 for the 9.0.x branch (fixed in 9.0.0.M10)
  • >= 8.5.1 and < 8.5.5 for the 8.5.x branch (fixed in 8.5.5)
  • >= 8.0.34 and < 8.0.37 for the 8.0.x branch (fixed in 8.0.37)
  • >= 7.0.70 and < 7.0.71 for the 7.0.x branch (fixed in 7.0.71)

There is an important Classloader related bug in 8.0.32 which makes impossible to use the code macro or write Python scripts so you should avoid this version if possible. See https://bz.apache.org/bugzilla/show_bug.cgi?id=58999.

  • XWiki 12.0+ requires a Tomcat version >= 8 since it requires Servlet 3.1+
  • Older versions of XWiki require a Tomcat version >= 7 since it requires Servlet 3.0+
  • Tomcat 7 is not using URF-8 by default. Edit the conf/server.xml file to set the UTF-8 encoding:
    <Connector port="8080"
               ...
               URIEncoding="UTF-8">
    </Connector>

Get Connected