Skip to content

Installing to Servers

Note: Documentation for installing license keys can be found here.

Installing Licenses on Servers

The possible ways of installing license files on a server (web applications e.g. Jchem Microservices)::

  1. Using system variables (recommended):

    The location of the license file can be set with:

    • chemaxon.license.url Java system property

      It is possible to define multiple license files of arbitrary locations. The separator character is ";".

      In case license files are set this way, they are being read from all locations defined by the environment variable, the Java system property and from the user's home directory.

      Example: -Dchemaxon.license.url="C:\Chemaxon\license2009.cxl;C:\Chemaxon\license2010.cxl"

  2. Automatic install:

    The license file is automatically recognized when stored in the .chemaxon (Unix) or chemaxon (Windows) sub-directory under the home directory of the user running the application. The following locations are accepted:

    • (.)chemaxon/license.cxl (file name is fixed)
    • (.)chemaxon/licenses/*.cxl (the license file can have arbitrary name, the extension is fixed)
  3. Command line install:

    Launch the license shell script (Unix) or license.bat batch file (Windows) available in the JChem downloadable packages.

    Type license -h for the list of available options.

  4. Using Java API:

    chemaxon.license.LicenseManager.setLicenseFile(String path)

    chemaxon.license.LicenseManager.setLicense(String s)

If the licenses are installed later, when a web application is already running, it is not necessary to restart the web server (e.g. Tomcat), the License Manager will automatically and repeatedly check if a license file was installed in the meanwhile.

For Windows server administrators:

In some cases, it can happe when a Chemaxon product is being run as a service by the System Profile, than despite all effort no Environment Variable is visible for the product. In this case our license check falls back to search the license in C:\Windows\System32\config\systemprofile\chemaxon\ folder, which is the user home of the System Profile. In this folder you can place a license.cxl file or create a licenses folder and copy all your .cxl files here, as described in point number 2. above.

Hosting servers with Docker

Generally, if you run the application in a Docker container, you should attach the license as follows.
This applies regardless of whether you use Docker Compose or build and run the image directly from a Dockerfile.

with license file

If you have license file than mount that to $HOME/.chemaxon

If the license file is changed, you can replace the old license file with the new one (using the same name) in your local filesystem, without having to rebuild the image.

Examples

Suppose the

docker run --name marvin -d \
-v /home/user/license.cxl:$HOME/.chemaxon/license.cxl \
-p 8080:8080 chemaxon.jfrog.io/cxn-docker-release/chemaxon/marvinws
version: "3.8"

services:
  app:
    image: chemaxon.jfrog.io/cxn-docker-release/chemaxon/marvinws
    environment:
    volumes:
      - ./license.lic:$HOME/.chemaxon/license.cxl

with license key

If you have a license key it's enough to inject your license key with CHEMAXON_LICENSE_SERVER_KEY as environment variable.

If the license key value should be changed (e.g. because of rotation of the license key), rebuild of the image is needed with the new CHEMAXON_LICENSE_SERVER_KEY.
Otherwise, runtime can be kept untouched.
App communicates with license server automatically, meaning any change in the underlying license will be reflected in the app, after the next license server communication round.

Examples

docker run --name marvin -d \
-e CHEMAXON_LICENSE_SERVER_KEY="your-license-key-here" \
-p 8080:8080 chemaxon.jfrog.io/cxn-docker-release/chemaxon/marvinws
version: "3.8"

services:
  app:
    image: chemaxon.jfrog.io/cxn-docker-release/chemaxon/marvinws
    environment:
      - CHEMAXON_LICENSE_SERVER_KEY=your-license-key-here

However, each application may have its own instructions, so please check those as well.

Hosting servers with Kubernetes

using a license key

To license the application, the CHEMAXON_LICENSE_SERVER_KEY environment variable must be supplied at runtime, ideally using a secret.
If the license key value should be changed (e.g. because of rotation of the license key), re-applying it might be needed.
Otherwise, the configuration during runtime can be kept untouched.
App communicates with license server automatically, meaning any change in the underlying license will be reflected in the app after the next license server interaction.

apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
    - name: mypod
      image: chemaxon-application
      env:
        - name: CHEMAXON_LICENSE_SERVER_KEY
          valueFrom:
            secretKeyRef:
              name: licensekey
              key: license_server_key

using a license file

In Kubernetes, administrators have the option to use the secrets API. You can use a license file, which can be mounted as a volume. Chemaxon products use $CHEMAXON_HOME to store temporary files, not just license files, so using a mounted secret can cause read only file system errors.
It is recommended that administrators use a combination of secret volumes and the environment variable $CHEMAXON_LICENSE_URL.

# An example podspec that assumes that a license file was added as
# kubectl create secret generic licensefile --from-file=license.cxl
apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
  - name: mypod
    image: chemaxon-application
    # The full path depends on the file added as a secret
    env:
      - name: CHEMAXON_LICENSE_URL
        value: "/run/secrets/license/license.cxl"
    volumeMounts:
    - name: licensefile
      mountPath: "/run/secrets/license/"
      readOnly: true
  volumes:
  - name: licensefile
    secret:
      secretName: licensefile