Configuring and Starting LexFloatServer
Configuring LexFloatServer
LexFloatServer reads all its settings from config.yml, included with every LexFloatServer release. This page covers the settings you need to get started. For all settings, see the Config Reference.
By default, LexFloatServer looks for config.yml in the same folder as the executable. If the file is in another folder, pass its path with the -c option.
The file is read when the server starts, so restart LexFloatServer after you change it.
What goes in the config file
The file has two kinds of settings:
- Server-wide settings apply to the whole server, such as the port, network, and logging.
- Product settings list the products the server serves, with the settings for each product, such as its product file and license key.
configVersion: 2
server:
port: 8090
...
...
products:
- productFilePath: ./products/ProductA.dat
displayName: Product A
licenseKey: AAAAAA-AAAAAA-AAAAAA-AAAAAA-AAAAAA
enabled: trueSettings marked with * are required.
| Setting | What to put there |
|---|---|
server.port* | Port that your app and the local dashboard connect to, for example 8090. |
productFilePath* | Path to the product's Product.dat file. Download it from the actions menu on the Products page in the admin portal. |
displayName | Name shown for this product in the local dashboard. |
licenseKey | The license key of the product's on-premise-floating license. |
enabled | Turns the product on or off. With true, the server serves the product. With false, the product stays configured in the file but the server does not serve it, for example when one of several products should be paused for a while. Set it back to true and restart LexFloatServer to serve it again. Default: true. |
Adding more products
Add one entry under products for each product:
products:
- productFilePath: ./products/ProductA.dat
displayName: Product A
licenseKey: AAAAAA-AAAAAA-AAAAAA-AAAAAA-AAAAAA
enabled: true
- productFilePath: ./products/ProductB.dat
displayName: Product B
licenseKey: BBBBBB-BBBBBB-BBBBBB-BBBBBB-BBBBBB
enabled: trueTo give one product its own lease duration or offline borrowing limits, see Product settings.
Enabling HTTPS
With ssl.enabled set to true, LexFloatServer serves every request over HTTPS instead of HTTP, on the same port. Plain HTTP requests are rejected. LexFloatClient traffic is encrypted even without HTTPS. HTTPS adds encryption for the API endpoints and the local dashboard, which send the API key, access tokens, and login passwords.
To enable HTTPS:
-
Create a certificate for the server. Your customer can use a self-signed certificate. For example, with OpenSSL:
openssl req -x509 -newkey rsa:2048 -nodes -days 365 \
-keyout server-key.pem -out server-cert.pem \
-subj "/CN=myfloatingserver" \
-addext "subjectAltName=DNS:myfloatingserver,IP:10.0.4.10"Replace
myfloatingserverand10.0.4.10with the host name and IP address that clients use to reach the server. -
Set the SSL settings in
config.yml:ssl:
enabled: true
certificateFilePath: ./server-cert.pem
certificateKeyFilePath: ./server-key.pem -
Restart LexFloatServer.
-
Use
https://URLs. In your app, pass anhttps://URL to LexFloatClient, for exampleSetHostUrl("https://myfloatingserver:8090"). Scripts and the local dashboard also usehttps://.
If the certificate or key file is missing or invalid, LexFloatServer does not start and logs an SSL certificate error.
Starting LexFloatServer in the terminal
LexFloatServer can run in two ways:
- In a terminal (command prompt). It stops when you close the terminal.
- As a system service, for normal use. It starts with the machine and runs in the background. See Installing LexFloatServer.
To start it in a terminal, pass the -s option:
lexfloatserver -sThe log shows each product as it loads. A product that is not activated yet is reported, but the server still starts, so you can activate the product next.
Command-line options
lexfloatserver <command> [options]Pass one command each time you run the program.
| Command | Description |
|---|---|
-s, --start | Start the server in the terminal. |
-a, --activate | Activate product licenses. |
-d, --deactivate | Deactivate product licenses. |
-g, --generate-offline-request | Create an offline activation request file. |
--status | Show the license status of each product. |
-i, --install | Install the server as a system service. |
-u, --uninstall | Uninstall the system service. |
-h, --help | Show every command and option. |
-v, --version | Show the version. |
A command applies to every enabled product in config.yml. To run it for some products only, pass -p once for each product file.
Run lexfloatserver --help for the full list of options.
Examples
# Check every product
lexfloatserver --status
# Activate every enabled product with the license key in its config entry
lexfloatserver -a
# Activate one product with a license key passed on the command line
lexfloatserver -a -p ./products/ProductA.dat -l LICENSE_KEY
# Start only two products
lexfloatserver -s -p ./products/ProductA.dat -p ./products/ProductB.dat
# Install a system service that runs only Product A
lexfloatserver -i -p ./products/ProductA.dat --service-name myfloatingserver