upgrading oXygen License Servlet

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
JoergSachse
Posts: 2
Joined: Mon Mar 08, 2021 12:08 pm

upgrading oXygen License Servlet

Post by JoergSachse » Mon Mar 08, 2021 12:51 pm

Hello everyone,

I'm trying to automate the installation & upgrade process for the oXygen License Servlet using Ansible, because this is the standard procedure for documentation and disaster recovery at our company. This includes downloading and deploying a fresh WAR to Apache Tomcat 9 on Debian 10. During the upgrade deployment, the Tomcat server needs to be restarted and the Servlet loses all of the license information (as expected).

The page https://www.oxygenxml.com/doc/versions/ ... _server_wa says:
By default, the license server stores the statistics database and other data in the Java Servlet Container's temporary directory. If you are not using Apache Tomcat, this directory may be deleted when the server is stopped or restarted. However, you can set the oxygen.license.server.work.dir system property to specify a different path for the directory where the database is stored.
I've found databases in "/var/lib/tomcat9/work/Catalina/localhost/oXygenLicenseServlet/db/", but guessing from their filenames, they only contain log information. Also, there's a licence file at "/var/lib/tomcat9/work/Catalina/localhost/oXygenLicenseServlet/license.txt", but it contains a Machine signature that changes during WAR deployment. However, eeploying a new WAR seems to change the Machine Signature for the license server, so this file cannot be reused either.

My main questions are:
  • Where exactly do I set the "oxygen.license.server.work.dir" parameter? Can you give me a canonical filepath?
  • How can I make the Machine Signature persistent? Alternatively, where do I get the Machine signature so I can make the lisence into a template that can be used during deployment?
  • Which files need to be backed up before upgrading to a new version of the License Servlet?
The page https://www.oxygenxml.com/doc/versions/ ... rvlet.html describes a manual process and thus cannot be used.

Any help is very much appreciated. If you need any more details, I'll do my best to provide them. Thank you and all the best,
Joerg

mihai_coanda
Posts: 37
Joined: Wed Jul 20, 2016 8:22 am

Re: upgrading oXygen License Servlet

Post by mihai_coanda » Wed Mar 10, 2021 10:57 am

Hello,

The license binding process ensures only one server using this license key runs at once.
If you only upgrade an existing installation, on the same machine, by replacing the existing deployment the upgraded installation and continue to work with the current license key.

From what I understand you create a new machine for upgrades and disaster recovery that causes the previously activated license key to no longer work as it was bound to another server (the user database continues to be picked up even on other servers). In order to move the license key to a new machine, you will need to contact our sales department by email at salex@oxygenxml.com to deactivate the binding to the failed server ( the license key that you want deactivated should be mentioned in the email).


Where exactly do I set the "oxygen.license.server.work.dir" parameter? Can you give me a canonical filepath?


This parameter allows you to store the license server database and the activated license key to another directory, other than the default one which in your case is /var/lib/tomcat9/work/Catalina/localhost/oXygenLicenseServlet/. This should be used if the server container that you are using does not keep the data directory between restarts but that is not your case.



How can I make the Machine Signature persistent? Alternatively, where do I get the Machine signature so I can make the lisence into a template that can be used during deployment?

The Machine Signature is presented in the License Server UI so manual activation is required on new installations
The Machine Signature ties the license to a machine and deployment (file paths and ports are using when computing it) so it will not remain the same on another deployment by design, there is no way to force this persistence between deployments.



Which files need to be backed up before upgrading to a new version of the License Servlet?

The /var/lib/tomcat9/work/Catalina/localhost/oXygenLicenseServlet/ folder and all of its content should be backed up on upgrades and just copied at the same path to preserve the server configuration and state.


Regards,
Michael
Michael
http://www.oxygenxml.com

JoergSachse
Posts: 2
Joined: Mon Mar 08, 2021 12:08 pm

Re: upgrading oXygen License Servlet

Post by JoergSachse » Thu Mar 11, 2021 11:17 am

Hi Michael,

thank you for your help; I do understand that recovering on a fresh system will require support to do a reset of the license activation before deployment.

I followed your recommendation for the upgrading procedure (NOT "rebuild to recover" on another machine) and did:

Code: Select all

# stop tomcat9 service
sudo systemctl stop tomcat9.service

# backup folder and all of its content before update
sudo cp -r /var/lib/tomcat9/work/Catalina/localhost/oXygenLicenseServlet /tmp/

# download new WAR version
cd /tmp/
wget https://www.oxygenxml.com/InstData/LicenseServlet/oXygenLicenseServlet.war

# overwrite existing WAR with updated version
sudo cp oXygenLicenseServlet.war /var/lib/tomcat9/webapps/

# restore backup
sudo cp -r /tmp/oXygenLicenseServlet /var/lib/tomcat9/work/Catalina/localhost/

# reset permissions that were changed due to use of sudo
sudo chown -R tomcat.tomcat /var/lib/tomcat9/work/Catalina/localhost/oXygenLicenseServlet
sudo find /var/lib/tomcat9/work/Catalina/localhost/oXygenLicenseServlet -type f -exec chmod g+r \{\} \;
sudo find /var/lib/tomcat9/work/Catalina/localhost/oXygenLicenseServlet -type d -exec chmod g+rx \{\} \;

# start tomcat9 service
sudo systemctl start tomcat9.service
Apparently, the Machine Signature for my license server ("0RSq...6w==") doesn't change, which is a good sign. Also, the License server version is now stated as "23.1.2021030312" in the "Current Allocated Licenses" page. Before that, it was version "21.1.2019072215", so that's good, too.

Even though the initial issue is solved for me, please allow me one additional question: in the backup of "/var/lib/tomcat9/work/Catalina/localhost/oXygenLicenseServlet/", there's this subdirectory called "org/" that contains "*.java" and "*.class" files. I'm really not an expert on Java applications and Tomcat, but these look suspiciously like they could contain not only data but also code that belongs to the older version of the License Servlet WAR. Is it safe to use those older versions with the newer WAR?

Regards,
Joerg

mihai_coanda
Posts: 37
Joined: Wed Jul 20, 2016 8:22 am

Re: upgrading oXygen License Servlet

Post by mihai_coanda » Fri Mar 12, 2021 11:43 am

Hello Joerg,

Those files are generated by Tomcat, being generated from Jsp files and Tomcat updates them on any change made to the .jsp file so keeping them should not represent an issue.
If you desire you can remove that folder when updating.

Regards,
Michael
Michael
http://www.oxygenxml.com

Post Reply