Tomcat Installation

Version 7.2 by KarlEilebrecht on 2010/06/18

Installation Steps

  • Download and install Tomcat. It's usually as simple as unzipping it in a directory. Let's call this directory TOMCAT_HOME.
  • Extract the XWiki WAR into a directory named xwiki in TOMCAT_HOME/webapps/. The reason you're expanding the WAR is because you'll need to modify one configuration file from inside the WAR later on when you configure the database access.
  • Edit your conf/server.xml to set UTF-8 encoding: <Connector port="8080" ... URIEncoding="UTF-8"/>
  • (optional) If you want to modify the port on which Tomcat will run, edit TOMCAT_HOME/conf/server.xml/. Search for 8080 (sometimes 8180 if you are under Linux) and replace with the port value you wish to use.
  • (optional) It is possible to setup Tomcat Java Server as a UNIX Daemon - JSVC. Just follow this instructions. The only reason to make Tomcat a daemon is to make it runnable on the 80th port, which can be replaced by using NginX as a proxy on the 80th port and then forwarding to Tomcat to the 8080th port.

Potential Issues

Out Of Memory Error

When you later run XWiki in Tomcat you may get an Out Of Memory error, especially if you're trying to import large files into your wiki. To solve this allocate more memory to the JVM. For Tomcat this can be done by setting the JAVA_OPTS environment property (on Windows to allocate 300MB you would set JAVA_OPTS to -Xmx300m). Another important option is the MaxPermSize parameter. Example: -XX:MaxPermSize=1g allocates 1GB of Permanent memory. If you are running Tomcat as service then defining JAVA_OPTS will not help. There is a utility provided in the bin folder of your Tomcat installation (for example for Tomcat 5.x on Windows it's called tomcat5w.exe). It's a GUI tool which can be used to set various options including the heap size.

Java Security Manager

By default Tomcat is configured to have the Java Security Manager turned on. See the sample policy file for more details.

If you want to turn off the Java Security Manager for Tomcat, edit the Tomcat startup script. You might also want to check your /etc/init.d/tomcat file or /etc/default/tomcat5.5. You should see the following in the file:

# Use the Java security manager? (yes/no)
TOMCAT5_SECURITY=

Set it to no to turn off the Security Manager.

Tags:
   

Get Connected