Skip to content

Installing on a pristine Tomcat

This section explains how to deploy OpenKM on a pristine Apache Tomcat.

Take a look at the installation of the whole system for your operating system:

Download the latest Tomcat version ( Tomcat 9 ) from the Apache Tomcat page and extract it into the directory where you want to install it.

Once Tomcat has been extracted, some modifications are necessary.

Copy the following required libraries to TOMCAT_HOME/lib. These files can be found in the Tomcat distribution already configured by the OpenKM team, which can be downloaded from http://download.openkm.com/okm/tomcat-9.0.82.zip

  • unicode.ttf

Copy the following files to TOMCAT_HOME:

  • openkm.properties
  • logback.xml

Modify the following files in TOMCAT_HOME/conf:

setenv.sh or setenv.bat

Depending on your Operating System, you may have to create a file called setenv.sh in Linux or setenv.bat in Windows. This file should be placed in TOMCAT_HOME/bin. This is the content in the case of Linux:

JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx4096m -XX:+UseG1GC -XX:+UseStringDeduplication"
JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$CATALINA_HOME"
JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true -Dmail.mime.ignoreunknownencoding=true"
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djava.awt.headless=true"
JAVA_OPTS="$JAVA_OPTS -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider"
CATALINA_PID=$CATALINA_HOME/catalina.pid
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/bin/cadviewer

And this is the content in the case of Windows:

set JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx4096m -XX:+UseG1GC -XX:+UseStringDeduplicationset JAVA_OPTS=%JAVA_OPTS% -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%CATALINA_HOME%set JAVA_OPTS=%JAVA_OPTS% -Djava.net.preferIPv4Stack=true -Dmail.mime.ignoreunknownencoding=trueset JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djava.awt.headless=trueset PATH=%PATH%;%CATALINA_HOME%\bin\cadviewer

With Tomcat stopped, copy the OpenKM.war file into TOMCAT_HOME/webapps

Terminal window
$ mv openkm.war $TOMCAT_HOME/webapps

To do this, go to the section corresponding to your Operating System:

Terminal window
$ vim TOMCAT_HOME/openkm.properties

Your configuration file should contain something like this:

# OpenKM Hibernate configuration valuesspring.datasource.driver-class-name=com.mysql.jdbc.Driverspring.datasource.url=jdbc:mysql://localhost:3306/okmdb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8&nullNamePatternMatchesAll=true&serverTimezone=Europe/Madridspring.datasource.username=openkmspring.datasource.password=openkm
# JPA stuffspring.jpa.hibernate.ddl-auto=createspring.jpa.properties.hibernate.dialect=com.openkm.db.dialect.MySQL5InnoDBDialect
# Logback configuration file
logback.config=logback.xml

First-time application startup:

Terminal window
$ start openkm

When the application starts, you should see these log messages:

2015-07-04 18:28:10,680 [main] INFO org.apache.coyote.http11.Http11Protocol - Starting ProtocolHandler ["http-bio-0.0.0.0-8080"]
2015-07-04 18:28:10,688 [main] INFO org.apache.coyote.ajp.AjpProtocol - Starting ProtocolHandler ["ajp-bio-127.0.0.1-8009"]
2015-07-04 18:28:10,692 [main] INFO org.apache.catalina.startup.Catalina - Server startup in 41456 ms

The application will be accessible at http://YOUR_IP:8080/openkm using the user okmAdmin and the password admin. (Do not forget to change it!) For more information: Manage users and roles.