Tomcat update

By default OpenKM is installed with Tomcat 7.0.61 but every few weeks a new version is released and maybe you want your installation up to date. In this case you ask in the forum at http://forum.openkm.com to ensure this new version has been packaged by the OpenKM Team. Once you have verified and downloaded the new version is available you have to follow these steps:

Before updating Tomcat we recommend to upgrade your OpenKM version to 6.3.3 and ensure you have a recent working backup.

OpenKM versions previous to 6.3.3 are not compatible with Tomcat 7.0.61, so upgrade your OpenKM instance to this version and after that update Tomcat to 7.0.61.

  • Stop the current Tomcat
  • Unzip the new downloaded one
  • Copy these files and folders from the old Tomcat to the new one:
    • conf/server.xml
    • conf/context.xml
    • OpenKM.cfg
    • OpenKM.xml
    • repository
    • plugins
  • Edit the conf/server.xml file and comment or remove these lines:
<!-- Automatically reload log4j configuration -->
<Listener className="com.openkm.util.Log4JInitializer" configFile="${catalina.base}/conf/log4j.properties"/>
  • Update your Tomcat service configuration:
    • In case of Linux, change the Tomcat path at /etc/init.d/tomcat
    • In case of Windows, change the Tomcat path in the service configuration
  • Start the new Tomcat

Verify folder and files permissions after copying or moving them. In Linux you can set them recursivelly:

$ sudo chown openkm:openkm tomcat-7.0.61 -R 

 

Rememeber to update the backup script because the location of the Tomcat directory would change. In case of Linux you can check it by doing (as root):

$ crontab -l

This way, you can see the location of the backup script.

Preserving the old Tomcat is a good idea, but keep on mind that the backup script usually backups all the /home/openkm directory so move it to another place.

If you want a more recent branch you can try Tomcat 8.5, but keep on mind that this new branch has not been fully tested. In this case further modifications are needed because this new Tomcat uses another pool:

 

Tomcat 7Tomcat 8
maxActive maxTotal
maxWait maxWaitMillis

Tomcat 7

<Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
          maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1"
          username="openkm" password="*****" driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/okmdb?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF8"/>

Tomcat 8

<Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
          maxTotal="100" maxIdle="30" maxWaitMillis="10000" validationQuery="select 1"
          username="openkm" password="*****" driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/okmdb?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF8"/>