Installing on RedHat and CentOS (Manual)
Esta página aún no está disponible en tu idioma.
Preliminaries
Section titled “Preliminaries”Check disk size
Section titled “Check disk size”$ df -hCreate a user named openkm
Section titled “Create a user named openkm”$ sudo adduser openkmCheck server configuration
Section titled “Check server configuration”$ wget -Nc smxi.org/inxi$ sudo chmod +x inxi$ sudo ./inxi -FIncrease ulimit
Section titled “Increase ulimit”$ sudo vim /etc/security/limits.confadd the following lines to the end of the file (before the line # End of file)
* soft nofile 6084
* hard nofile 6084
Checking Java version
Section titled “Checking Java version”$ java -versionIf Java is correctly installed on your computer, the name and version of the Java virtual machine is displayed:
openjdk version "1.8.0_212"OpenJDK Runtime Environment (build 1.8.0_212-b04)OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)Install Java
Section titled “Install Java”$ sudo yum install java-1.8.0-openjdk-develSet OpenJDK 1.8 as your default Java version
Section titled “Set OpenJDK 1.8 as your default Java version”$ alternatives --config javaInstalling database
Section titled “Installing database”Install MySQL if you do not have it already installed:
$ sudo yum install mysql-server mysqlConfigure it as service:
$ sudo chkconfig --levels 235 mysqld onChange MySQL root password
Section titled “Change MySQL root password”Do it only If it’s necessary to change the MySQL root password.
Method 1
Section titled “Method 1”$ /usr/bin/mysqladmin -u root -h localhost password 'password'Method 2
Section titled “Method 2”$ sudo /etc/init.d/mysql stop$ sudo mysqld --skip-grant-tables &$ mysql -u root mysql> UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root';> FLUSH PRIVILEGES;> exit;Method 3
Section titled “Method 3”$ mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';> flush privileges;Method 4
Section titled “Method 4”$ sudo /etc/init.d/mysql stop$ mysqld_safe --skip-grant-tables &$ mysql -u root mysql> UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root';> FLUSH PRIVILEGES;> exit;More information at MySQL : Reseting permissions.
Check InnoDB is default MySQL engine
Section titled “Check InnoDB is default MySQL engine”$ mysql -h localhost -u root -p> show engines;If it not default, modify /etc/mysql/my.cnf
$ vim /etc/mysql/my.cnfand under [mysqld] add
default-storage-engine = innodb
Create database
Section titled “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
Section titled “Installing Tomcat”$ cd /home/openkm$ unzip Tomcat-7.0.61.zipConfiguring Tomcat as a service
Section titled “Configuring Tomcat as a service”Create a file with the script:
$ sudo vim /etc/init.d/tomcat#!/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/echoTEST=/usr/bin/testTOMCAT_USER=openkmTOMCAT_HOME=/home/openkm/tomcat-7.0.61TOMCAT_START_SCRIPT=$TOMCAT_HOME/bin/startup.shTOMCAT_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 1esacexit 0Make it executable:
$ sudo chmod 755 /etc/init.d/tomcatUpdate the run-levels:
$ sudo chkconfig tomcat --level 2345 onCheck the service
Section titled “Check the service”Start the service:
$ sudo service tomcat startStop the service:
$ sudo service tomcat stopInstalling OpenKM
Section titled “Installing OpenKM”With tomcat stopped copy the OpenKM.war file into /home/openkm/tomcat-7.0.61/webapps
$ cp OpenKM.war /home/openkm/tomcat-7.0.61/webappsInstalling thirdparty software
Section titled “Installing thirdparty software”| Software | Required | Description |
|---|---|---|
| OpenOffice or LibreOffice | Yes | Check these packages are present: - openoffice.org-ure-3.1.1-19.5.el5_5.6 - openoffice.org-headless-3.1.1-19.5.el5_5.6 - openoffice.org-pyuno-3.1.1-19.5.el5_5.6 Execute this command line to check the installed packages: bash<br>$ rpm -qa | grep openoffice<br>Take the names of the packages as an orientation. If headless package is not installed OpenKM will not be able to start soffice 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> |
| Htop | no | Download from http://pkgs.repoforge.org/htop/bash<br>$ rpm -ivH htop-1.0.3-1.el6.rf.x86_64.rpm<br> |
Start application
Section titled “Start application”Check OpenKM.cfg parameters
Section titled “Check OpenKM.cfg parameters”$ vim /home/openkm/tomcat-7.0.61/OpenKM.cfgYour configuration should be something like this:
# OpenKM Hibernate configuration values
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
hibernate.hbm2ddl=create
First time application start:
$ service tomcat startTo check if the startup process can execute the command:
$ tail -f /home/openkm/tomcat-7.0.61/log/catalina.logWhen the application is started you’ll see in 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 msThe 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');Linux Oracle 7.X Throubleshooting
Section titled “Linux Oracle 7.X Throubleshooting”The libreoffice and tesseract tools are not into the default repositories, you cal follow the steps described in the URL below for installing them:
Install libreoffice from RPM
Section titled “Install libreoffice from RPM”$ yum remove openoffice* libreoffice*$ cd /opt$ wget https://www.libreoffice.org/donate/dl/rpm-x86_64/6.0.4/es/LibreOffice_6.0.4_Linux_x86-64_rpm.tar.gz$ tar -xvf LibreOffice_6.0.4_Linux_x86-64_rpm.tar.gz$ cd LibreOffice_6.0.4_Linux_x86-64_rpm/RPMS$ yum localinstall *.rpmInstall Tesseract
Section titled “Install Tesseract”#!/bin/sh
cd /opt
yum -y updateyum -y install libstdc++ autoconf automake libtool autoconf-archive pkg-config gcc gcc-c++ make libjpeg-devel libpng-devel libtiff-devel zlib-devel
#Install AutoConf-Archivewget ftp://mirror.switch.ch/pool/4/mirror/epel/7/ppc64/a/autoconf-archive-2016.09.16-1.el7.noarch.rpmrpm -i autoconf-archive-2016.09.16-1.el7.noarch.rpm
#Install Leptonica from Sourcewget http://www.leptonica.com/source/leptonica-1.75.3.tar.gztar -zxvf leptonica-1.75.3.tar.gzcd leptonica-1.75.3./autobuild./configuremakemake installcd ..
#!/bin/sh
#Install Tesseract from Sourcewget https://github.com/tesseract-ocr/tesseract/archive/3.05.01.tar.gztar -zxvf 3.05.01.tar.gzcd tesseract-3.05.01./autogen.shPKG_CONFIG_PATH=/usr/local/lib/pkgconfig LIBLEPT_HEADERSDIR=/usr/local/include ./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/libLDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" makemake installldconfigcd ..
#Download and install tesseract language fileswget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/ben.traineddatawget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/eng.traineddatawget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.traineddatawget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/tha.traineddatawget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/osd.traineddatamv *.traineddata /usr/local/share/tessdata
#Download Hindi Cube datawget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.bigramswget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.foldwget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.lmwget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.nnwget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.paramswget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.cube.word-freqwget https://github.com/tesseract-ocr/tessdata/raw/3.04.00/hin.tesseract_cube.nnmv hin.* /usr/local/share/tessdata
ln -s /opt/tesseract-3.05.01 /opt/tesseract-latestOther common additional setup configurations
Section titled “Other common additional setup configurations ”OpenKM comes with a lot of configuration parameters we suggest taking a look at: Recommended configuration parameters.