This tutorial shows how you can update the Apache Tomcat in your CzechIdM deployment. In this particular howto we are updating from Tomcat 8.5.11 to Tomcat 8.5.50. If necessary, adjust performed commands to your needs.
Apache Tomcat application container is a part of the CzechIdM stack and its update requires some service downtime. When done correctly, this downtime can be a matter of minutes - but you shall always plan for the worst. :) As always, there is a number of things to consider.
event-executor
threads..domain.tld
) is invalid, but unfortunately those are session cookies given out by the OpenAM upon successful user authentication. (This issue has already been solved, but it is still a great example.)Following list can be used as a basis for the maintenance checklist. Feel free to customize it to better suit your needs. You can safely perform almost all steps of this guide on a running system and then just switch the Tomcat distribution.
/opt/tomcat
alongside existing installation.cd /opt/tomcat/apache-tomcat-8.5.50 chmod -vR o+rX ./ chgrp -R tomcat conf/ bin/ lib/ chmod g+rwx conf/ chmod g+r conf/* chown -R tomcat webapps/ work/ temp/ logs/ cd /opt/tomcat chgrp tomcat apache-tomcat-8.5.50/
server.xml
- disabling shutdown port and tying AJP (8009/tcp) and HTTP (8080/tcp) ports to localhost.webapps/
directory.cd /opt/tomcat/apache-tomcat-8.5.50/lib/ ln -sv /usr/share/java/postgresql-jdbc.jar
setenv.sh
file from the old Tomcat's bin/
directory to the bin/
of the new Tomcat. Make sure the file has correct permissions.idm.war
file from the old Tomcat's webapps/
directory to the webapps/
of the new Tomcat.systemctl stop tomcat # here you should make database backup; you should not need it at all, just to be safe cd /opt/tomcat unlink current ln -s apache-tomcat-8.5.50 current systemctl start tomcat
Returning back from an unsuccessful update means just swapping back to the old Tomcat installation. It requires some downtime. (In this example, we are returning to the 8.5.11 version of Tomcat.)
systemctl stop tomcat cd /opt/tomcat unlink current ln -s apache-tomcat-8.5.11 current systemctl start tomcat
The error message "The server understood the request but refuses to authorize it." when coming to IdM through Apache web server means that you have to set AJP secret
ProxyPass / ajp://127.0.0.1:8009/ secret=**tomcat_ajp_secret**
in the /etc/httpd/conf.d/ssl.conf
as written in the standard server preparation tutorial (httpd_installation_and_configuration).