Installing on Windows

This section of the documentation tries to describe how to install OpenKM manually. An OpenKM Installer tool does most things automatically; more information at Using the installer.

Preliminaries

If you plan to configure OpenKM in a cluster or sharding mode, please, before starting the installation process, read the following sections:

Check that you have enough disk space.

We recommend installing these tools:

  • Geany (text editor).
  • mTail (Windows program that works like the Unix command "tail").

Checking Java version

C:\> java -version

 If Java is correctly installed on your computer, the name and version of the Java virtual machine are displayed:

java version "1.8.0_312."
Java(TM) SE Runtime Environment (build 1.8.0_312-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.312-b07, mixed mode)

The Java version may differ depending on the version you have installed, but we recommend the latest 1.8 release.

We also recommend setting the JAVA_HOME variable:

setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0_312" /M

Install Java

Do these steps only if Java 8 is not installed on your server.

 If the required version of Java is not installed on your computer:

  1. Download it from the Oracle website (Java 8) and choose the appropriate platform for your hardware and Windows version.
  2. Run the downloaded .exe file and follow the instructions displayed.

Installing database

Install MySQL if you do not already have it installed:

Download MySQL MSI Installer from MySQL Community Server and follow the installation wizard steps.

If you do not have MySQL client software, installing MySQL Workbench is also a good idea.

Check InnoDB is the default MySQL engine

show engines;

It should show something like this:

| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys  | YES | YES | YES |

If it is not the default, modify c:\ProgramData\MySQL\MySQL Server 5.6\my.ini

and under [mysqld], add

default-storage-engine = innodb

After changing the default MySQL engine, the MySQL service must be restarted to take effect.

Create database

CREATE DATABASE okmdb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
CREATE USER openkm@localhost IDENTIFIED BY 'password';
GRANT ALL ON okmdb.* TO openkm@localhost WITH GRANT OPTION;

Installing Tomcat

Unzip Tomcat-8.5.69.zip to c:\

The Tomcat version number may vary if upgraded to a newer major version.

 Copy files from C:\tomcat-8.5.69\bin\x86 or C:\tomcat-8.5.69\bin\x64 to C:\tomcat-8.5.69\bin based on the server architecture.

Configuring Tomcat as a service

Register for the service:

Open a Windows terminal as administrator.

 

cd c:\tomcat-8.5.69\bin

service.bat install

Set the JVM parameters for the Tomcat service:

cd c:\tomcat-8.5.69\bin

openkm //US//OpenKM ++JvmOptions="-Xms1024m"
openkm //US//OpenKM ++JvmOptions="-Xmx4096m"
openkm //US//OpenKM ++JvmOptions="-XX:+UseG1GC"
openkm //US//OpenKM ++JvmOptions="-XX:+UseStringDeduplication"
openkm //US//OpenKM ++JvmOptions="-XX:+HeapDumpOnOutOfMemoryError"
openkm //US//OpenKM ++JvmOptions="-XX:HeapDumpPath=%CATALINA_HOME%"
openkm //US//OpenKM ++JvmOptions="-Djava.net.preferIPv4Stack=true"
openkm //US//OpenKM ++JvmOptions="-Dmail.mime.ignoreunknownencoding=true"
openkm //US//OpenKM ++JvmOptions="-Dfile.encoding=UTF-8"
openkm //US//OpenKM ++JvmOptions="-Dsun.jnu.encoding=UTF-8"
openkm //US//OpenKM ++JvmOptions="-Djava.awt.headless=true"
openkm //US//OpenKM ++JvmOptions="-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider"

Run openkmw.exe as administrator.

Check the configuration parameters:

Also, you can change "Startup type" to Automatic.

   

More information about how to configure the Tomcat service on Windows is available at: http://tomcat.apache.org/tomcat-8.5-doc/windows-service-howto.html

Check the service

From terminal

Start the service:

$ net start OpenKM

Stop the service:

$ net stop OpenKM

From the Windows service panel

From openkmw tool

Configuring environment variables

Add the bin folder to the PATH environment variable:

setx PATH "%PATH%;C:\tomcat-8.5.69\bin" /M

These operations can also be done from the Windows environment variables:

The following screens could be quite different depending on your Windows OS version.

 

Installing OpenKM

With Tomcat stopped, copy the OpenKM.war file into /home/openkm/tomcat-8.5.69/webapps

$ copy openkm.war c:\tomcat-8.5.69\webapps

Install third-party software:

SoftwareRequiredDescription

LibreOffice

Yes

We recommend using LibreOffice rather than OpenOffice because it has better compatibility with Microsoft Office formats.

Tesseract

No

Download from https://tesseract-ocr.github.io/tessdoc/Installation.html and follow the installation wizard.

ClamAV

No

Download from http://www.clamav.net/download.html and follow the installation wizard.

ImageMagick

No

Tomcat bundle comes with an embedded convert tool.

If you decide to install it, go to http://www.imagemagick.org/script/binary-releases.php, download the latest binary release, and follow the installation wizard.

Keep in mind that 16-bit builds require more hardware resources than 8-bit builds.

We suggest ImageMagick-6.9.1-7-Q8-x64-dll.exe rather than ImageMagick-6.9.1-7-Q16-x64-dll.exe (note the version numbering may differ due to ImageMagick version upgrades).

GhostScript

No

Tomcat bundle comes with an embedded Ghostscript tool.

Go to http://ghostscript.com/download/gsdnld.html and follow the installation wizard if you decide to install it.

   There is also an Extras.zip file available that contains all this software as a portable edition.

Start application

Check openkm.properties parameters

C:\> geany c:\openkm\openkm.properties

Your configuration should be something like this:

# OpenKM Hibernate configuration values
hibernate.dialect=com.openkm.db.dialect.MySQL5InnoDBDialect
hibernate.hbm2ddl=create-only

# Initial configuration - Windows
system.openoffice.path=C:/Program Files (x86)/LibreOffice

Ensure hibernate.dialect=com.openkm.db.dialect.MySQL5InnoDBDialect is enabled if your database is MySQL.

First-time application start:

$ net start OpenKM

Use the mTail program, or an equivalent, to watch the c:\tomcat-8.5.69\log\catalina.log file.

When the application is started, you'll see it in the log file in the lines:

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

Configure default extensions:

Go to Administration > Utilities > Database query and execute:

INSERT INTO OKM_EXTENSION (EXT_UUID, EXT_NAME) VALUES ('808e7a42-2e73-470c-ba23-e4c9d5c3a0f4', 'Live Edit');
INSERT INTO OKM_EXTENSION (EXT_UUID, EXT_NAME) VALUES ('58392af6-2131-413b-b188-1851aa7b651c', 'HTML Editor 4');
INSERT INTO OKM_PROFILE_MSC_EXTENSION (PEX_ID, PEX_EXTENSION) VALUES (1, '808e7a42-2e73-470c-ba23-e4c9d5c3a0f4');
INSERT INTO OKM_PROFILE_MSC_EXTENSION (PEX_ID, PEX_EXTENSION) VALUES (1, '58392af6-2131-413b-b188-1851aa7b651c');

Access from other computers

Access from other computers will be denied by default due to Windows Firewall configuration. To enable access from anywhere, please execute this command:

netsh advfirewall firewall add rule name="OpenKM" dir=in action=allow protocol=TCP localport=8080

Other standard additional setup configurations 

OpenKM comes with many configuration parameters. Please take a look at Recommended configuration parameters.