PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Running PxPlus with Multiple Licenses  (Read 240 times)

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3267
  • Mike King
    • View Profile
    • PVX Plus Technologies
Running PxPlus with Multiple Licenses
« on: December 13, 2019, 12:02:26 PM »
If you need one machine to run PxPlus with multiple licenses, it’s actually quite easy to setup. 

Here's a typical scenario:

A company has purchased licenses for its two branch operation; a ten user license for the system in Montreal and a twenty user license for the system in Toronto.  Management now decides that instead of having two servers they want to consolidate the branch operation onto a single server in the cloud.

Technically you can simply install two copies of PxPlus in separate locations and run them on different ports, but that means when upgrading the software you would have to upgrade both instances.  It might be better, and easier, if you only used one install of PxPlus.

To do this, all you need to do is have multiple license files and point different instances of PxPlus to the different license files.

Here is a small Linux shell script that can be used to make it simple to accomplish this:

  • #!/bin/bash
    lic=$PWD/lic_$1
    [ ! -d "lic_$1" ] && mkdir $lic
    export PVXKEY=$lic
    shift
    $@

Take the above script and place it in your PxPlus install directory in a file called 'usekey', then set execute permission on this file using the following command:

  • chmod a+x ./usekey

What this script does is allow you to specify the license to use when launching pxplus or the registration program pxpreg.  It creates a sub-directory "lic_XXXX" to hold the license if it doesn't already exist, then sets the PVXKEY environment variable to point to that directory.

So taking our example, to register the license for Montreal we could enter the following:

  • ./usekey MTL ./pxpreg

This would create a sub-directory called lic_MTL and run ./pxpreg against it allowing you to enter the license keys.

For Toronto you could enter:

  • ./usekey TOR ./pxpreg

Once you have the keys setup you can use the same script to run the Simple CS interface for each of the branches:

For Montreal to allow user to connect to port 10000:

  • ./usekey MTL ./pxplus "*plus/cs/host" -arg 10000

For Toronto to allow user to connect to port 10001:

  • ./usekey TOR ./pxplus "*plus/cs/host" -arg 10001

This approach can be extended to allow any number of different types of licenses to be run from the same install.

What if I'm on Windows?

You can setup a similar script on Windows as a .BAT file.  It would look something like this:

  • @ECHO OFF
    SETLOCAL
    SET lic=%CD%\lic_%1
    IF NOT EXIST %lic% MKDIR %lic%
    SET PVXKEY=%lic%
    %2 %3 %4 %5 %6 %7
Take the above script and place it in your PxPlus install directory in a file called ‘usekey.bat’.