Configure Apache Tomcat manually
To configure Apache Tomcat manually, copy JAR and WAR files to Tomcat, add database drivers, edit the server.xml file, and then start Tomcat.
Review the environment IDs. Specifying an environment ID is optional. However, if you speciy an ID, use the same value for each MobileFirst runtime environment managed by the same MobileFirst Server administration component. Moreover, this value must match the environment ID used when the MobileFirst Server administration component is installed. For more information about the ibm.worklight.admin.environmentid JNDI property, see Configure a MobileFirst project in production using JNDI environment entries.
- Copy the MobileFirst JAR file to the Tomcat lib directory:
- On UNIX and Linux systems: cp MF_HOME/WorklightServer/worklight-jee-library.jar tomcat_install_dir/lib
- On Windows systems: copy /B MF_HOME\WorklightServer\worklight-jee-library.jar tomcat_install_dir\lib\worklight-jee-library.jar
- Add the database drivers to the Tomcat lib directory. See the instructions for the appropriate DBMS in Create the databases manually.
- Copy the project.WAR file to the Tomcat web application directory, tomcat_install_dir/webapps, and rename it according to the context root. For example:
- If the context root is /worklight, rename it to worklight.war.
- If the context root is /, rename it to ROOT.war.
- Edit tomcat_install_dir/conf/server.xml to declare the context and properties of the MobileFirst application:
<!-- Declare the MobileFirst runtime environment. --> <Context path="/worklight" docBase="worklight"> <Environment name="ibm.worklight.topology.platform" value="Tomcat" type="java.lang.String" override="false"/> <Environment name="ibm.worklight.topology.clusterMode" value="Standalone" type="java.lang.String" override="false"/> <!-- Declare the worklight and worklight reports databases. --> <!-- <Resource name="jdbc/WorklightDS" type="javax.sql.DataSource" ... /> --> <!-- <Resource name="jdbc/WorklightReportsDS" type="javax.sql.DataSource" ... /> --> </Context>Where we must uncomment and complete the <Resource> element to declare the administration database as described in the following sections:
- Configure Apache Tomcat for DB2 manually
- Configure Apache Tomcat for Derby manually
- Configure Apache Tomcat for MySQL manually
- Configure Apache Tomcat for Oracle manually
Make sure that the path and docBase attributes are both consistent with the WAR file name. That is, if the WAR file name is worklight.war, set the path to "/worklight" and the docBase to "worklight". Whereas if the WAR file name is ROOT.war, set the path to "" and the docBase to "ROOT".
If the environment ID is set for the administration services, set the variable ibm.worklight.admin.environmentid to the same value.
- Start Tomcat.
Parent topic: Deploy a project WAR file manually.