This section describes how you can install the Camunda BPM platform and its components on a vanilla Apache Tomcat 8, if you are not able to use the pre-packaged Tomcat distribution. Regardless, we recommend that you download a Tomcat 8 distribution to fetch the required Camunda modules.

Reading the Guide

Throughout this guide we will use a number of variables to denote common path names and constants:

  • $TOMCAT_HOME points to the main directory of the tomcat server.
  • $PLATFORM_VERSION denotes the version of the Camunda BPM platform you want to install or already have installed, e.g. 7.0.0.
  • $TOMCAT_DISTRIBUTION represents the downloaded pre-packaged Camunda BPM distribution for Tomcat, e.g. camunda-bpm-tomcat-$PLATFORM_VERSION.zip or camunda-bpm-tomcat-$PLATFORM_VERSION.tar.gz.

Setup

Before you can install the Camunda components, you need to perform a number of required setup steps.

Create the Database Schema and Tables

In the default configuration of the distribution, the database schema and all required tables are automatically created in an H2 database when the engine starts up for the first time. If you do not want to use the H2 database, you have to

  • Create a database schema for the Camunda BPM platform yourself.
  • Execute the SQL DDL scripts which create all required tables and default indices.
    The SQL DDL scripts reside in the sql/create folder of the distribution:

$TOMCATDISTRIBUTION/sql/create/*_engine$PLATFORMVERSION.sql$TOMCAT_DISTRIBUTION/sql/create/*_identity$PLATFORM_VERSION.sql

As an alternative, you can also find a collection of the SQL scripts on our Nexus. Select the respective version and download the scripts as a zip or tar.gz file, then open the camunda-sql-scripts-$PLATFORM_VERSION/create folder.

There is an individual SQL script for each supported database. Select the appropriate script for your database and run it with your database administration tool (e.g., SqlDeveloper for Oracle).

When you create the tables manually, then you have to configure the engine to not create tables at startup by setting the databaseSchemaUpdate property to false (or, in case you are using Oracle, to noop). In Tomcat, this is done in the bpm-platform.xml, located in the $TOMCAT_DISTRIBUTION\server\apache-tomcat-$VERSION\conf\ folder.

Heads Up!

If you have defined a specific prefix for the entities of your database, then you will have to manually adjust the create scripts accordingly so that the tables are created with the prefix.

Please note further that READ COMMITED is the required isolation level for database systems to run Camunda with. You may have to change the default setting on your database when installing Camunda. For more information see the documentation on isolation levels.

Add BPM Bootstrap Server Listener

Add the entry org.camunda.bpm.container.impl.tomcat.TomcatBpmPlatformBootstrap as Listener before the GlobalResourcesLifecycleListener in your $TOMCAT_HOME/conf/server.xml. This class is responsible for starting and stopping the Camunda BPM platform as Tomcat is started and stopped.

  1. <Server port="8005" shutdown="SHUTDOWN">
  2. ...
  3. <Listener className="org.camunda.bpm.container.impl.tomcat.TomcatBpmPlatformBootstrap" />
  4. ...

Configure a JDBC Resource

To configure a JDBC Resource you have to edit the file $TOMCAT_HOME/conf/server.xml. This could look like the following example for an H2 database:

  1. <Server>
  2. ...
  3. <GlobalNamingResources>
  4. ...
  5. <Resource name="jdbc/ProcessEngine"
  6. auth="Container"
  7. type="javax.sql.DataSource"
  8. factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
  9. uniqueResourceName="process-engine"
  10. driverClassName="org.h2.Driver"
  11. url="jdbc:h2:./camunda-h2-dbs/process-engine;MVCC=TRUE;TRACE_LEVEL_FILE=0"
  12. username="sa"
  13. password=""
  14. maxActive="20"
  15. minIdle="5" />
  16. </GlobalNamingResources>
  17. </Server>

Add Required Libraries

Copy all libraries from the $TOMCAT_DISTRIBUTION/lib/ folder to the Tomcat library folder $TOMCAT_HOME/lib:

Furthermore, you have to merge your corresponding JDBC driver into the folder $TOMCAT_HOME/lib.

Add bpm-platform.xml

You have to add the file bpm-platform.xml to the folder $TOMCAT_HOME/conf or, optionally, you can configure the location through some available mechanisms, see Configure location of the bpm-platform.xml file:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <bpm-platform xmlns="http://www.camunda.org/schema/1.0/BpmPlatform"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://www.camunda.org/schema/1.0/BpmPlatform http://www.camunda.org/schema/1.0/BpmPlatform ">
  5. <job-executor>
  6. <job-acquisition name="default" />
  7. </job-executor>
  8. <process-engine name="default">
  9. <job-acquisition>default</job-acquisition>
  10. <configuration>org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration</configuration>
  11. <datasource>java:jdbc/ProcessEngine</datasource>
  12. <properties>
  13. <property name="history">full</property>
  14. <property name="databaseSchemaUpdate">true</property>
  15. <property name="authorizationEnabled">true</property>
  16. <property name="jobExecutorDeploymentAware">true</property>
  17. </properties>
  18. </process-engine>
  19. </bpm-platform>

Optional Components

This section describes how to install optional Camunda dependencies onto a Tomcat server. None of these are required to work with the core platform.

Cockpit, Tasklist and Admin

The following steps are required to deploy the applications:

  • Download the Camunda web application that contains both applications from our Maven Nexus Server.Or switch to the private repository for the enterprise version (User and password from license required).Choose the correct version named $PLATFORM_VERSION/camunda-webapp-tomcat-$PLATFORM_VERSION.war.
  • Copy the war file to $TOMCAT_HOME/webapps/camunda.war.Optionally you may name it differently or extract it to a folder to deploy it to a different context path.
  • Startup Tomcat.
  • Access Cockpit and Tasklist via /camunda/app/cockpit and /camunda/app/tasklist or under the context path you configured.

    REST API

The following steps are required to deploy the REST API:

  • Download the REST API web application archive from our Maven Nexus Server.Or switch to the private repository for the enterprise version (User and password from license required).Choose the correct version named $PLATFORM_VERSION/camunda-engine-rest-$PLATFORM_VERSION-tomcat.war.
  • Copy the war file to $TOMCAT_HOME/webapps.Optionally you may rename it or extract it to a folder to deploy it to a specific context like /engine-rest.
  • Startup Tomcat.
  • Access the REST API on the context you configured.For example, http://localhost:8080/engine-rest/engine should return the names of all engines of the platform, provided that you deployed the application in the context /engine-rest.

    Camunda Connect

Add the following artifacts (if not existing) from the folder $TOMCAT_DISTRIBUTION/lib/ to the folder $TOMCAT_HOME/lib/:

  • camunda-connect-connectors-all-$CONNECT_VERSION.jar
  • camunda-connect-core-$CONNECT_VERSION.jar
  • camunda-engine-plugin-connect-$CAMUNDA_VERSION.jar
  • camunda-commons-utils-$COMMONS_VERSION.jar
    In order to activate Camunda Connect functionality for a process engine, a process engine plugin has to be registered in $TOMCAT_HOME/conf/bpm-platform.xml as follows:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <bpm-platform ...>
  3. <process-engine name="default">
  4. ...
  5. <plugins>
  6. ... existing plugins ...
  7. <plugin>
  8. <class>org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin</class>
  9. </plugin>
  10. </plugins>
  11. ...
  12. </process-engine>
  13. </bpm-platform>

Camunda Spin

Add the following artifacts (if not existing) from the folder $TOMCAT_DISTRIBUTION/lib/ to the folder $TOMCAT_HOME/lib/:

  • camunda-spin-dataformat-all-$SPIN_VERSION.jar
  • camunda-spin-core-$SPIN_VERSION.jar
  • camunda-engine-plugin-spin-$CAMUNDA_VERSION.jar
  • camunda-commons-utils-$COMMONS_VERSION.jar
    In order to activate Camunda Spin functionality for a process engine, a process engine plugin has to be registered in $TOMCAT_HOME/conf/bpm-platform.xml as follows:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <bpm-platform ...>
  3. ...
  4. <process-engine name="default">
  5. ...
  6. <plugins>
  7. ... existing plugins ...
  8. <plugin>
  9. <class>org.camunda.spin.plugin.impl.SpinProcessEnginePlugin</class>
  10. </plugin>
  11. </plugins>
  12. ...
  13. </process-engine>
  14. ...
  15. </bpm-platform>

Groovy Scripting

Add the following artifacts (if not existing) from the folder $TOMCAT_DISTRIBUTION/lib/ to the folder $TOMCAT_HOME/lib/:

  • groovy-all-$GROOVY_VERSION.jar

    Freemarker Integration

Add the following artifacts (if not existing) from the folder $TOMCAT_DISTRIBUTION/lib/ to the folder $TOMCAT_HOME/lib/:

  • camunda-template-engines-freemarker-$TEMPLATE_VERSION.jar
  • freemarker-2.3.20.jar
  • camunda-commons-utils-$COMMONS_VERSION.jar

原文: https://docs.camunda.org/manual/7.9/installation/full/tomcat/manual/