Connecting to a Remote Licence Server

In this section, you will learn to configure Squore to rely on a remote licence server instead of using the licence server embedded into your local installation. This is useful when you run a production server and a development server, and you want the licence to be shared between both installations.

Note

Before you follow these steps, ensure that the two Squore servers are installed and start up correctly as described in Chapter 3, Installing Squore Server and Chapter 4, Starting Squore and that the remote licence server listens to requests from remote machines:

<interface name="public">
	<inet-address value="${jboss.bind.address:0.0.0.0}"/>
</interface>

Tip

If both servers are running on the same machine, then each server must be identified as a specific instance for this configuration to work. You can achieve this by editing the server element at the root of <SQUORE_HOME>/server/standalone/configuration/standalone.xml and adding a name attribute as shown below:

<?xml version='1.0' encoding='UTF-8'?>
<server name="production" xmlns="urn:jboss:domain:4.2">
...
</server>

Assign a different name for each server installation before you start following the procedure below.

Warning

This procedure involves modifying <SQUORE_HOME>/server/standalone/configuration/standalone.xml and removing one of the default applications deployed automatically by the installation or upgrade script. These changes therefore have to be applied again after upgrading Squore.

In order to point a local Squore server to a licence served by a remote Squore installation, carry out the following steps:

  1. On the remote license server (optional):

    By default, the password of the ejb user is changeme. If you want to change the password, then:

    1. Generate a new password with this command:

      echo -n "ejb:ApplicationRealm:new_password" | md5sum

      where new_password is the password to assign to the user.

    2. Edit <SQUORE_HOME>/server/standalone/configuration/application-users.properties to specify the new password as shown below:

      #
      # Properties declaration of users for the realm 'ApplicationRealm' which is the default realm
      # for application services on a new AS 7.1 installation.
      # (...)
      ejb=bc0deae7c29cd133a2de015f36ab6132
    3. Restart Squore Server.

  2. On the local server:

    1. Stop Squore Server.

    2. Edit <SQUORE_HOME>/server/standalone/configuration/squore-server.properties. Add the property:

      license.remote = true

    3. Edit <SQUORE_HOME>/server/standalone/configuration/standalone.xml

      .
    4. Find the remote-ejb outbound-socket-binding element and edit its remote-destination definition accordingly so that the host and port match the hostname and http port of the remote server (8080 plus the offset you defined during installation, so 8180 by default). Here is an example of the complete configuration block:

      <outbound-socket-binding name="remote-ejb">
      	<remote-destination host="remoteLicenceServer" port="8180"/>
      </outbound-socket-binding>

    5. Optionally, if you have changed the default password for the ejb user on the remote server, look for the ejb-security-realm security-realm element , and modify the secret value with the output of the command

      echo -n "new_password" | openssl base64

      . Here is an example of the complete block:

      <security-realm name="ejb-security-realm">
      	<server-identities>
      		<secret value="bmV3X3Bhc3N3b3Jk"/>
      	</server-identities>
      </security-realm>

    6. Restart Squore Server

    7. Run the following command, with port matching the controller port of the installation (9990 plus the offset defined at install time, so 10090 by default):

      <SQUORE_HOME>/server/bin/jboss-cli.sh -c \
       --controller=localhost:10090 \
       --command="undeploy squore-license.ear"

The local Squore Server is now using a remote licence server.