Deploying a WAR on Apache Tomcat

A WAR file is provided for the Apache Tomcat installation that contains many of the files needed for Magnolia. When the WAR file is deployed, the files in the WAR file are extracted and placed in the server’s webapps directory. The remaining directories and files, including the repositories, are retrieved during the deployment and installation.

Server configuration with relaxedQueryChars

Advanced query filters in the Delivery API require extra Tomcat configuration, namely setting relaxedQueryChars="[]|".

Deploy WAR

Tomcat should not be running when executing the following procedure.

To deploy WAR file:

  1. Download DX Core or Community Edition WAR file.

  2. Put WAR file into server’s webapps directory.

  3. Adapt JVM heap size by editing the applicable file in the /bin directory in the Apache Tomcat directory:

    • On Unix, edit setenv.sh file and add:
      export CATALINA_OPTS="-server -Xmx1024m"

    • On Windows, create setenv.bat file and add:
      set CATALINA_OPTS=-server -Xmx1024m

  4. (Optional) Use headless mode.

    When running on a system without a GUI, you should set the java.awt.headless system property to true.

    • On Unix:
      export CATALINA_OPTS="-server -Xmx1024m -Djava.awt.headless=true"

    • On Windows:
      set CATALINA_OPTS=-server -Xmx1024m-Djava.awt.headless=true

  5. Start Tomcat and wait until it is completely started.

When deploying the Magnolia WAR file Tomcat will need time and heap size to extract the file and bootstrap repositories. Once bootstrapped, Tomcat will not need that much heap anymore.

A directory containing the content of the WAR file and retrieved files is created in the server’s webapps directory.

Tomcat configuration

If you need to configure Tomcat to use virtual hosts, data sources and so on, see the Tomcat Documentation.

Known issues

Unable to log in with an SSO/OpenID setup

In your Tomcat configuration, make sure that the Cookie processor component does not have the CookieProcessor defined, so remove this line:

<CookieProcessor sameSiteCookies="..." />

The issue has been identified and will be fixed in 6.2.10 (MAGNOLIA-8112).

Using Tomcat with Apache

Magnolia recommends using Tomcat with Apache due to the high availability of skilled staff to configure Apache and the ability to configure Apache to serve static fallback content when Tomcat is down.

Feedback