1) Get the hostID (Your customer)
Your customer will need to get the hostID of the target computer on which the FortLM license server will run..
To get the hostID one can run 'flmid' command.
use 'flmid -h' to get a list of supported command options.
2) You create a license file
You can use sample_network_floating_license.txt distributed with FortLM as a template to create your network-floating license files.
The first line (the SERVER=, PORT=,IP=, and ANYIF= keyword/value pairs) can be left as it is. Your customer will need to change them to match their settings.
We need to change "SEATS=" to the number of floating licenses you sold to your customers. In our demo application, since we use the feature string "demo" so we need to change the FEATURE=demo;. We need to change the hostID= to the hostID of the computer that will run our license server application (Your customer will send this to you). We also need to change the START= and EXPIRE= dates.
Finally we MUST assign an UUID (universal unique ID, used as Serial Number) for the floating license file. The UUID is used by FortLM license server to prevent your customers from running multiple copies of a license server instance. You can generate a UUID using the "uuidgen" utility command on Windows and Linux. Of course you are also free to use your own Serial Number scheme.
3) You sign the license file
You must use FortLM's utility command to flmsign to sign your license files.
flmsign /path-to/champsign-license-file /path-to/sample_floating_license.key /path-to/sample_vendor_priv_key.pem
4) Deliver the signed license file to your customer
This usually is done via email.
5) How do your customer use the network license file?
A) Edit the license file to add server name and a free port number
Using a text editor, your customers will need to edit the line (usually the first line) that contains keywords "SERVER=", "PORT=", "IP=", and "ANYIF=". In the following we will first explain what these keywords mean.
SERVER= server host name or its IP address
PORT= server port: must be a free port number on this host.
To avoid using privileged/restricted ports pick a port number > 1024.
IP= IP version to use: [v4 | v6], default v4
ANYIF= Should a license server listens on all interfaces? [yes|no]...
Thus, if we use IP address and our server's IP address is 192.168.2.2, then after editing the first line will become:
If we use hostname and our server's hostname is brick.acme.com, then after editing the first line will become:
Keep other parts unchanged and save the file as (e.g.) fortlm_license.lic
B) Start FortLM license server
To start FortLM license server serving the license, run command:
flmserver -f /path-to/fortlm_license.lic /path-to/sample_vendor_pub_key.pem
You should see a message indicating server is up and listens on port 12345. To save the console output to a log file, use redirection. For example, "flmserver /path-to/license.key ./sample_vendor_pub_key.pem > myserver.log". To start license server automatically when the computer reboots, on Linux you can place it in the rc.local file. For example, on Redhat Linux, edit /etc/rc.d/rc.local, and add the following line
/path-to/flmserver -f /path-to/fortlm_license.lic /path-to/sample_vendor_pub_key.pem
To get the status of the server and see how many licenses have been checked out, run command:
Check out how to run FortLM license server automatically across reboot
C) Install a copy of the license file on the client computers
A copy of the edited fortlm_license.lic file that is used to run the license server should be distributed to all users of your the application. This is done typically by your customer.
On a client computer an environment variable needs to be set up and points to the license file in order to run your application. The name of that environment variable is picked by your application ("CHAMPLMS_DEMO_APP_LICENSE for the demo application). In the real world, your application will probably automate this step by placing the license file in a fixed location.
For instance, on Windows 7, to set the environment variable, click "Start->Control Panel->System and Security->System", select "Advanced System Settings", and then select "Environment Variables". Now in the "system variables" section or "user variables for..." section, click the "new" button, create a variable named as "CHAMPLMS_DEMO_APP_LICENSE", and set its value to "C:\myLicenses\license.txt", assuming the license file "license.txt" is stored under "C:\myLicenses".
On Linux, using bash, one can edit the .bashrc under the user's home directory, and add the following line:
Now your customer can run champlm_demo successfully. They should see the following message printed in the console:
>>Process license file: c:\champlicense\x86\win\sample_floating_license.key
Feature demo verified Ok.
Now we have passed license checking, do some work...