Skip to content
Other versions

Loading…

Installing on RedHat and CentOS (Manual)

Terminal window
$ df -h
Terminal window
$ sudo adduser openkm
Terminal window
$ wget -Nc smxi.org/inxi
$ sudo chmod +x inxi
$ sudo ./inxi -F
Terminal window
$ sudo vim /etc/security/limits.conf

Add the following lines to the end of the file (before the line # End of file)

*   soft  nofile   6084

*   hard  nofile   6084

Terminal window
$ java -version

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

Terminal window
openjdk version "1.8.0_352"
OpenJDK Runtime Environment (build 1.8.0_352-b08)
OpenJDK 64-Bit Server VM (build 25.352-b08, mixed mode)
Terminal window
$ sudo yum install java-1.8.0-openjdk

Set OpenJDK 1.8 as your default Java version.

Section titled “Set OpenJDK 1.8 as your default Java version.”
Terminal window
$ alternatives --config Java

Install MariaDB if it is not already installed:

Terminal window
$ sudo yum install mariadb-server

Configure it as a service:

Terminal window
$ sudo systemctl enable mariadb

Do this only if it’s necessary to change the MariaDB root password.

Terminal window
$ /usr/bin/mysqladmin -u root -h localhost password 'password.'
Terminal window
$ sudo systemctl stop mariadb
$ sudo mysqld --skip-grant-tables &
$ mysql -u root mysql
> UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root';
> FLUSH PRIVILEGES;
> exit;
Terminal window
$ mysql
> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
> FLUSH PRIVILEGES;

Check InnoDB is the default MariaDB engine

Section titled “Check InnoDB is the default MariaDB engine”
Terminal window
$ mysql -h localhost -u root -p
> show engines;

If it is not the default, modify /etc/my.cnf

Terminal window
$ vim /etc/mysql/my.cnf

Add the following under [mysqld]:

default-storage-engine = InnoDB

Terminal window
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;
Terminal window
$ cd /home/openkm
$ unzip Tomcat-8.5.69.zip

Create a file with the script:

Terminal window
$ sudo vim /etc/init.d/openkm
#!/bin/sh
### BEGIN INIT INFO
# Provides: tomcat
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop Apache Tomcat
# Description: Enable Apache Tomcat service provided by daemon.
### END INIT INFO
ECHO=/bin/echo
TEST=/usr/bin/test
TOMCAT_USER=openkm
TOMCAT_HOME=/home/openkm/tomcat-8.5.69
TOMCAT_START_SCRIPT=$TOMCAT_HOME/bin/startup.sh
TOMCAT_STOP_SCRIPT=$TOMCAT_HOME/bin/shutdown.sh
$TEST -x $TOMCAT_START_SCRIPT || exit 0
$TEST -x $TOMCAT_STOP_SCRIPT || exit 0
start() {
$ECHO -n "Starting Tomcat"
su - $TOMCAT_USER -c "$TOMCAT_START_SCRIPT &"
$ECHO "."
}
stop() {
$ECHO -n "Stopping Tomcat"
su - $TOMCAT_USER -c "$TOMCAT_STOP_SCRIPT 60 -force &"
while [ "$(ps -fu $TOMCAT_USER | grep java | grep tomcat | wc -l)" -gt "0" ]; do
sleep 5; $ECHO -n "."
done
$ECHO "."
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 30
start
;;
*)
$ECHO "Usage: tomcat {start|stop|restart}"
exit 1
esac
exit 0

Make it executable:

Terminal window
$ sudo chmod 755 /etc/init.d/openkm

Update the run-levels:

Terminal window
$ sudo chkconfig openkm --level 2345 on

Start the service:

Terminal window
$ sudo service openkm start

Stop the service:

Terminal window
$ sudo service openkm stop

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

Terminal window
$ cp openkm.war /home/openkm/tomcat-8.5.69/webapps
Software Required Description
LibreOffice Yes Execute the following command to check the installed packages:
bash<br>$ rpm -qa | grep -i libreoffice<br>
Use the package names as a guide.
If the headless package is not installed, OpenKM will not start the office service.
Tesseract No Some useful links:
- https://code.google.com/p/tesseract-ocr/wiki/Compiling
- https://code.google.com/p/python-tesseract/wiki/HowToCompileForCentos
- http://www.vicchiam.com/blog/?p=168
ClamAV No Some useful links:
- http://www.clamav.net/doc/install.html#rhel
ImageMagick Yes bash<br>$ yum install ImageMagick<br>
GhostScript Yes bash<br>$ yum install ghostscript<br>
Top No Download from http://pkgs.repoforge.org/htop/
bash<br>$ rpm -ivH htop-1.0.3-1.el6.rf.x86_64.rpm<br>

By default, this port is closed, so you need to open it:

Terminal window
$ firewall-cmd --permanent --add-port 8080/tcp
$ firewall-cmd --reload

More information at:

Terminal window
$ vim /home/openkm/tomcat-8.5.69/openkm.properties

Your configuration should be something like this:

# OpenKM Hibernate configuration values
spring.JPA.properties.hibernate.dialect=com.openkm.db.dialect.MySQL5InnoDBDialect
spring.jpa.hibernate.DDL-auto=create-only

First-time application start:

Terminal window
$ service tomcat start

To check if the startup process can execute the command:

Terminal window
$ tail -f /home/openkm/tomcat-8.5.69/log/catalina.log

When the application is started, you’ll see in the log file 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, please check: Manage users and roles.

Configure the 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');

The LibreOffice and Tesseract tools are not in the default repositories; you can follow the steps described in the URL below to install them:

#!/bin/sh
cd /opt
yum -y update
yum -y install libstdc++ autoconf automake libtool autoconf-archive pkg-config gcc gcc-c++ make libjpeg-devel libpng-devel libtiff-devel zlib-devel
#Install AutoConf-Archive
wget ftp://mirror.switch.ch/pool/4/mirror/epel/7/ppc64/a/autoconf-archive-2016.09.16-1.el7.noarch.rpm
rpm -i autoconf-archive-2016.09.16-1.el7.noarch.rpm
#Install Leptonica from Source
wget http://www.leptonica.com/source/leptonica-1.75.3.tar.gz
tar -zxvf leptonica-1.75.3.tar.gz
cd leptonica-1.75.3
./autobuild
./configure
make
make install
cd ..
#!/bin/sh
#Install Tesseract from Source
wget https://github.com/tesseract-ocr/tesseract/archive/3.05.01.tar.gz
tar -zxvf 3.05.01.tar.gz
cd tesseract-3.05.01
./autogen.sh
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LIBLEPT_HEADERSDIR=/usr/local/include ./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib
LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make
make install
ldconfig
cd ..
#Download and install tesseract language files
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/ben.traineddata
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/eng.traineddata
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.traineddata
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/tha.traineddata
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/osd.traineddata
mv *.traineddata /usr/local/share/tessdata
#Download Hindi Cube data
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.bigrams
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.fold
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.lm
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.nn
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.params
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.word-freq
wget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.tesseract_cube.nn
mv hin.* /usr/local/share/tessdata
ln -s /opt/tesseract-3.05.01 /opt/tesseract-latest

Other standard additional setup configurations 

Section titled “Other standard additional setup configurations ”

OpenKM has many configuration parameters; we suggest looking at Recommended configuration parameters.