WAR Installation documentation for the dotCMS Content Management System

You can deploy dotCMS as a .WAR on a variety of application servers.

Building the WAR File

The dotCMS distribution includes a buildwar script in the /bin directory that generates a dotcms.war file and places it in a new WAR directory. The war file generated includes all static plugins in the plugins directory, and can be used with any supported application server.

The WAR file includes configuration files and static plugins for use with your Application Server, but each application server requires some specific configuration steps. Make sure to read the section on your individual application server for specific configuration instructions.

Follow these steps to properly deploy dotCMS as a .WAR:

  1. Make sure your static plugins are in your /plugins directory.
  2. If running Tomcat application server ONLY:
    • Before building your .WAR file, configure your database in the dotserver/tomcat-X.X.XX/webapps/ROOT/META-INF/context.xml file.
  3. Run the buildwar script from the dotCMS /bin directory.
    • This creates a /WAR folder in the dotCMS distribution, and creates a ROOT.war file in the /WAR folder.
  4. Make specific configuration changes required for your Application Server.
  5. Move the WAR file to the location required by your Application Server.

dotCMS directory structure with WAR scripts and folder

Asset and Content Locations

The WAR file is intended to contain your application files that do not change. Therefore the WAR file contains all of the application files necessary to run dotCMS, but for any normal installation where you wish to dynamically modify the content in your dotCMS installation, the assets and other content files that are part of your dotCMS installation should not be included in the WAR file. Instead, your assets folder and your dynamic content path should point to locations outside the WAR file.

Specifically, the values of both the ASSET_REAL_PATH and DYNAMIC_CONTENT_PATH properties in your dotmarketing-config.properties file should point to folders outside the WAR file structure. Please see the Asset Storage and Dynamic Content Path documentation for more information on these properties, and please see above for how to change dotCMS configuration properties when deploying dotCMS using a WAR file.

Changing dotCMS Configuration Properties

Configuration changes made to dotCMS will automatically be included when you build the WAR file. Any changes you make to the configuration in the dotCMS distribution after you build the WAR file will not be included when you run dotCMS from the WAR file. To make changes to the configuration after building the WAR file, you must either:

  1. Rebuild and redeploy the WAR file, or
  2. Change the dotCMS configuration properties outside the WAR file.

Changing Configuration Outside the WAR File

You can make changes to the dotCMS configuration outside the WAR file by overriding dotCMS configuration properties using using environment variables and system variables. This enables you to easily deploy the same WAR file to multiple dotCMS servers and environments, while still providing specific configuration options and changes for each deployment.

For more information on changing dotCMS configuration properties, please see the Changing dotCMS Configuration Properties documentation.

Supported Application Servers

WAR deployment is supported in the following application servers. Please click the appropriate link below for information about specific configuration steps required for your application server: