Configure Tomcat
Steps
To install and configure Tomcat as your servlet container for XWiki:
- Download a supported version of Tomcat matching your XWiki version.
- Extract Tomcat to a directory of your choice, referred to as TOMCAT_HOME.
- Give enough memory to Java, since Tomcat's default settings are below what XWiki needs.
- Download the WAR file for the version you need.
- Extract the XWiki WAR file into a directory named xwiki inside TOMCAT_HOME/webapps/.
- Configure a relational database, since XWiki connects to it as soon as Tomcat auto-deploys the webapp.
- Create a directory to store XWiki's permanent data, holding attachments, configuration and extensions.
- Open TOMCAT_HOME/webapps/xwiki/WEB-INF/xwiki.properties and set the permanent directory path:
environment.permanentDirectory=/var/lib/xwiki/data - Configure Tomcat to use UTF-8 as the default encoding by adding the following JVM parameter to the Tomcat startup configuration, which the Linux packages of Tomcat generally set already:
-Dfile.encoding=UTF-8 - Start Tomcat using the method corresponding to your installation type:
- Manual installation:
- Linux/Mac: TOMCAT_HOME/bin/startup.sh
- Windows: TOMCAT_HOME\bin\startup.bat
- Service installation, for production environments:
- Linux (systemd): systemctl start tomcat
- Windows Service: net start Tomcat
- Manual installation:
- Open
http://localhost:8080/xwiki/bin/view/Main/in a browser. Tomcat deploys XWiki, which serves its Home page.
FAQ
Why does XWiki show a 500 error about a missing JDBC driver?
The WAR package does not include a JDBC driver. Configure a relational database manually and copy the required JAR to TOMCAT_HOME/webapps/xwiki/WEB-INF/lib/. For testing, you can instead use the Demo package, which includes HSQLDB.
Why should I set UTF-8 as the default encoding for Tomcat?
To avoid encoding-related issues in XWiki and its extensions, such as database drivers or connectors.
Should I enable Java headless mode for Tomcat?
Enable Java headless mode if Tomcat runs on a server without a graphical environment.
How can I modify the port 8080?
Edit server.xml and replace every occurrence of 8080, or of 8180 on some Linux systems, with the desired port.
Should Tomcat run as a UNIX daemon using JSVC?
Usually no. If you need port 80, use a reverse proxy (Nginx or Apache) to forward requests to Tomcat on 8080.
More
To find more about the current topic, you can search or use the table below and filter the columns to narrow your choices.