Tomcat
#
InstallationWarning Several people have had problems with Tomcat installations set up by Linux package managers, mainly due to permissions issues. We recommend installing according to these instructions instead.
The quickest way to get a working Tomcat:
Download the latest stable binary distribution (i.e.
tar.gz
) from the Apache Tomcat site.Unpack it like so:
#
After Installation#
UsersSet up a tomcat user with the 'manager' role by editing conf/tomcat-users.xml
like so:
You can check this works by accessing the manager interface at http://localhost:8080/manager/html.
If you used a package manager to get Tomcat, the manager may not be included. Here's the Debian command you need:
#
ContextEdit context.xml:
#
Server XMLYou also need to check in your server.xml
file that the correct UTF-8
encoding has been applied to all connectors in use (see CharacterEncoding). Make sure that every connector element in use reads as follows:
Without this, permalinks may break.
#
startup.shAdd this property in startup.sh:
Tomcat 7.0 has improved the enforcement of Expression Language rules and by default doesn't allow the use of Java keywords. This flag makes Tomcat 7 more permissive.
If tomcat is installed as service, add org.apache.el.parser.SKIP_IDENTIFIER_CHECK=true to /etc/tomcat7/catalina.properties instead of adding JAVA_OPTS in startup.sh.
#
Starting TomcatIf Tomcat isn't already running, start it with this command:
Visit the Tomcat manager at http://localhost:8080/. The username and password required to access the manager are webapp.manager
and webapp.password
as specified in your Mine properties file.
#
Stopping TomcatTo stop Tomcat, run this command:
You can't drop a database if Tomcat has an open connection to a Postgres database. You have to:
- Undeploy your webapp
- Restart tomcat
- dropdb
#
Common Errors#
Out of Memory ErrorsTo avoid java.lang.OutOfMemory
errors, specify the JVM heap size in $TOMCAT_HOME/bin/tomcat.sh
. You can specify the size as part of TOMCAT_OPTS
:
#
Session ErrorsIf you get a "Session Error" when you start up your webapp, you may need to update your Tomcat configuration to remove application path in front of sessions' cookies.
You get this error because the home page makes several requests but your session is lost between transactions with a new session started with the first query. For instance, when you go to the beta.flymine.org home page, your cookie path will initially be "/". To display the "most popular" template queries, a query is run on full URL using the path "/beta". The session with the "/" path is discarded and a new session cookie is created with the "/beta" path. (You can view the values stored in your cookies via your web browser.)
Add these 2 attributes to $TOMCAT/conf/context.xml
: