Installing on a pristine Tomcat

This section will depict how to deploy OpenKM in a pristine Apache Tomcat.

Preliminaries

Take a look at the installation of the whole system according to your Operating System:

Installing Tomcat

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

Once Tomcat has been extracted, some modifications are necessary.

Copy libraries and configuration files

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

  • unicode.ttf

Copy the following files to TOMCAT_HOME:

  • openkm.properties
  • logback.xml

Modify configuration files

Modify the following files from 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 context in the case of Linux:

JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx2048m -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 -Xmx2048m -XX:+UseG1GC -XX:+UseStringDeduplication
set JAVA_OPTS=%JAVA_OPTS% -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%CATALINA_HOME%
set JAVA_OPTS=%JAVA_OPTS% -Djava.net.preferIPv4Stack=true -Dmail.mime.ignoreunknownencoding=true
set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djava.awt.headless=true
set PATH=%PATH%;%CATALINA_HOME%\bin\cadviewer

Installing OpenKM

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

$ mv openkm.war $TOMCAT_HOME/webapps

Install third-party software

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

 Start application

Check openkm.properties parameters

$ vim TOMCAT_HOME/openkm.properties

Your configuration file should contain something like this:

# OpenKM Hibernate configuration values
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/okmdb?useUnicode=true&characterEncoding=UTF8&serverTimezone=CET&nullNamePatternMatchesAll=true
spring.datasource.username=openkm
spring.datasource.password=openkm
# JPA stuff
spring.jpa.hibernate.ddl-auto=create
spring.jpa.properties.hibernate.dialect=com.openkm.db.dialect.MySQL57InnoDBDialect   # Logback configuration file logback.config=logback.xml

This configuration works if your database is MySQL. In another case, please check the documentation for creating a support ticket.

First-time application start:

$ start openkm

Use mTail Program - or equivalent - to watch the TOMCAT_HOME\log\catalina.log file.

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 user: okmAdmin with password: admin. ( Do not forget to change it !). For more information: Manage users and roles.