Deploying FX Sales
This page provides an overview of the steps for deploying FX Sales.
Requirements
Install Tomcat
Download the latest version of Apache Tomcat 9 and extract the files to your desired directory.
For more information on installing Tomcat 9, see Tomcat Setup on the Tomcat website, and RUNNING.txt distributed with Tomcat.
Deploy the FX Sales WAR file
Follow the steps below:
-
Shut down Tomcat.
-
Delete all files and subdirectories in the
<tomcat_root>/webappsdirectory. -
Download the WAR file for your variant of FX Sales (
variantsalestrader-version.war) from the Caplin Downloads website. -
Copy the WAR file to your Tomcat webapps directory:
<tomcat_root>/webapps. -
Remove the version information from the file name of the WAR. For example,
variantsalestrader-2.20.0-12345.warbecomesvariantsalestrader.war.The directory now looks like this:
-
Create a web application context file
<tomcat_root>/conf/Catalina/localhost/variantsalestrader.xmlwith the following content:<?xml version='1.0' encoding='utf-8'?> <Context> <!-- Default set of monitored resources --> <WatchedResource>WEB-INF/web.xml</WatchedResource> <!-- Core JNDI configuration --> <Environment name="LIBERATOR.DOMAIN" value="example.com" (1) type="java.lang.String" override="false" /> <Environment name="LIBERATOR.PRIMARY.ADDRESS" value="lib1.example.com" (2) type="java.lang.String" override="false" /> <Environment name="LIBERATOR.PRIMARY.PORT" value="80" type="java.lang.String" override="false" /> <Environment name="LIBERATOR.PRIMARY.HTTPS.PORT" value="443" type="java.lang.String" override="false" /> <Environment name="LIBERATOR.SECONDARY.ADDRESS" value="lib2.example.com" (3) type="java.lang.String" override="false" /> <Environment name="LIBERATOR.SECONDARY.PORT" value="80" type="java.lang.String" override="false" /> <Environment name="LIBERATOR.SECONDARY.HTTPS.PORT" value="443" type="java.lang.String" override="false" /> <Environment name="CAPLIN.DEV.MODE" value="false" (4) type="java.lang.String" override="false" /> <Environment name="CAPLIN.LOGIN.ENABLED" value="true" (5) type="java.lang.String" override="false" /> </Context>1 Set LIBERATOR.DOMAINto your domain2 Set LIBERATOR.PRIMARY.ADDRESSto the hostname of your primary Liberator3 Set LIBERATOR.SECONDARY.ADDRESSto the hostname of your secondary Liberator4 Set CAPLIN.DEV.MODEtofalsein production deployments5 Set CAPLIN.LOGIN.ENABLEDtotrueto use FX Sales' built-in login pageFor more information on FX Sales' JNDI environment entries, see FX Sales JNDI configuration.
-
Review FX Sales' default HTTP headers configured in the WAR file’s
web.xmlfile. For recommended headers, see Recommended HTTP headers. For instructions on how to override HTTP default headers, see Setting HTTP headers.To view the default HTTP headers set in the
web.xmlfile, use the following command:$ unzip -p varianttrader-version.war WEB-INF/web.xml | less
Configure the Keymaster servlet
Follow the steps below to configure the Keymaster servlet.
-
Generate a new key pair for the web application’s Keymaster servlet:
#!/bin/bash # PKCS1 private key. Compatible with KeyMaster.NET. openssl genrsa -out privatekey_pkcs1.pem 2048 # Convert PKCS1 private key to PKCS8. Compatible with KeyMaster Java. openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in privatekey_pkcs1.pem -out privatekey.pem # Export public key. Compatible with Caplin Liberator. openssl rsa -pubout -outform DER -in privatekey_pkcs1.pem -out keymaster_public.der -
Copy the file
privatekey.pemto<tomcat_root>/conf/keymaster/. -
Set the location of the private key in the
<tomcat_root>/conf/Catalina/localhost/variantsalestrader.xmlfile:<!-- KeyMaster servlet configuration --> <Environment name="caplin.keymaster.privatekey.filename" value="../../conf/keymaster/privatekey.pem" type="java.lang.String" override="false" /> -
Copy the file
keymaster_public.derto the Deployment Framework directoryglobal-config/sslon all Liberator hosts.
Configure the SignOn servlet
If your deployment uses FX Sales' built-in sign in page (see CAPLIN.LOGIN.ENABLED in FX Sales' JNDI configuration), follow the steps below.
-
Generate a new key pair for the SignOn servlet.
#!/bin/bash # PKCS1 private key. openssl genrsa -out privatekey_pkcs1.pem 2048 # Convert PKCS1 private key to PKCS8. openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in privatekey_pkcs1.pem -out privateSignonKey.pem # Export public key. openssl rsa -pubout -outform PEM -in privateSignonKey.pem -pubout -out publicSignonKey.pem -
Copy both
privateSignonKey.pemandpublicSignonKey.pemto<tomcat_root>/conf/signon/. -
Set the location of the new keys in the
<tomcat_root>/conf/Catalina/localhost/variantsalestrader.xmlfile:<Environment name="caplin.signon.privatekey.filename" value="../../conf/signon/privateSignonKey.pem" type="java.lang.String" override="false"/> <Environment name="caplin.signon.publickey.filename" value="../../conf/signon/publicSignonKey.pem" type="java.lang.String" override="false"/>
Start Tomcat
If you start Tomcat manually, run the command below from Tomcat’s bin directory:
$ ./startup.sh
If you start Tomcat as a service, follow instructions in RUNNING.txt.
You can now access FX Sales on http://tomcat_host:tomcat_port/variantsalestrader.