Apache Tomcat

All projects supported by us require the following changes to be made in Apache Tomcat configuration.

Before making any changes to the Tomcat installation, make sure it does work properly.

UTF8 Encoding

In order for a web application to correctly display internationalized characters you need to modify your configuration 'conf/server.xml' file. To do this, set the property 'URIEncoding="UTF-8"' within all connectors definitions for your HTTP protocol.

    <Connector port="8080" protocol="HTTP/1.1"
            connectionTimeout="20000"
            redirectPort="8443" URIEncoding="UTF-8" />
            ...
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />

Endorsed Libraries

If a project contains './setup/endorsed/' or './setup/lib/' directories, you need to copy libraries inside those directories to accordingly '$CATALINA_HOME/endorsed/' and '$CATALINA_HOME/lib/'.

Minor Tweaks

Tomcat has a memory leak where large JSP page requests can fill up memory. To avoid this, edit Tomcat's 'bin/setenv.sh' (create it, if it does not exist). To improve performance (most of the time) for Tomcat, the server can be run with the Java option '-server'.

    export CATALINA_OPTS="-server -Xmx512m -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true"

It's recommended to place a definition of the CATALINA_OPTS variable in a 'CATALINA_HOME/bin/setenv.*' file.