# Configuring the end-to-end connection

Once you have the FX Motif front-end and back-end systems up and running, you’ll need to set up the connection between them. This page guides you through the configuration required to connect the back end to the front end.

## Prerequisites

* It is recommended that you complete the previous guides ([Setting up the front end](setting-up-the-front-end.md) and [Setting up the back end](setting-up-the-back-end.md)) before continuing.
* You will need access to your Caplin Trader root directory

**Files required:**

* keymaster.zip

## 1. Configuring the web server to access the back end

You’ll have seen from the [Setting up the front end](setting-up-the-front-end.md) guide, that [BladeRunner](../../caplin-trader/3/bladerunner/index.md) contains an instance of [Jetty](https://jetty.org/) (a web server) used to serve a web trading application (e.g. [NovoTrader](setting-up-the-front-end.md#novotraderreference)), as you develop on it. In the Jetty web server XML configuration, you will need to define the machine address where you have the back-end system running. This will allow the front end to communicate with the back end.

**Define the machine address for your backend in the web server XML:**

1. Locate the Caplin Trader root directory on your machine.
2. Navigate to _\CaplinTrader\apps\&lt;YOUR_APP_NAME>\WEB-INF\jetty-env.xml_, and open the XML file.

   **For example:** if you’ve used the example app namespace previously, the path would be: _\CaplinTrader \apps\NovoTrader\WEB-INF_ 
3. In the XML code, find the entry `<Arg>LIBERATOR.PRIMARY.ADDRESS</Arg>.`
4. Underneath this entry, locate `<Arg type="java.lang.String">ct-liberator-ci.caplin.com</Arg>`. **Change** `ct-liberator-ci.caplin.com` to the IP Address of the machine you are using to run the Deployment Framework (and Caplin back-end components from [Setting up the back end](setting-up-the-back-end.md))

**...Also** 

If you have **changed** the default port for the [Liberator](../../caplin-platform/liberator/index.md) (18080) in the Deployment Framework, you will also need to change the port accordingly in the XML configuration for the Jetty web server. You can find more details on changing Liberator’s port numbers [here](../../caplin-platform/deployment-framework/cdf-change-liberator-and-transformer-port-numbers.md). If you have not modified the port skip the next step.

**Define the primary liberator port in the web server configuration:**

1. In the _jetty-env.xml_ file, find the following entry `<Arg>LIBERATOR.PRIMARY.PORT</Arg>`
2. Underneath this entry, define your Liberator port number in here `<Arg type="java.lang.String">18080</Arg>`

## 2. Configuring the front end to use KeyMaster

[KeyMaster](../../caplin-platform/keymaster/index.md) facilitates the process of logging into [Liberator](../../caplin-platform/liberator/index.md) via [StreamLink](../../caplin-platform/streamlink/index.md). Upon initial authentication of a user, KeyMaster implements Public-key cryptography to maintain secure access to financial data contained within [Liberator](../../caplin-platform/liberator/index.md). In this step you will configure the front-end system to use KeyMaster. You will need access to the _keymaster.zip_ file.

**Configure KeyMaster for the front end:**

1. Navigate to your Caplin Trader root directory.
2. Create a new folder under _\CaplinTrader\conf\_ and name it 'keymaster'.
3. Now unzip _keymaster.zip_. Copy the file named _privatekey.store_ and place it in inside the newly created folder under _\CaplinTrader\conf\keymaster_

## 3. Launching your Motif application

Now you will start up the back-end and front-end systems. Once they have been initiated, you will log into your FX Professional Motif application.

**...Start**

**Run your FX Professional Motif application:**

1. Open Cygwin. Navigate to your Deployment Framework root directory, and enter the following command:

   `./dfw start` (This will start the back-end components)
2. Now open a command-line window. Navigate to _\CaplinTrader\sdk_ and execute:

   `bladerunner start` (This will initiate the front-end system)
3. Open a web browser and navigate to localhost:7070. From the dashboard, select the application tile (e.g. NovoTrader) and click **_Open_**. Now click the **_Launch App_** icon, in the top right corner of the dashboard.
4. You should now be directed to the Motif login page. The username/password fields may already be completed (user1@caplin.com/password)

   **📌 NOTE**\
   From this point on you are able to directly access this login page URL providing you have BladeRunner started.
5. Click **_Login_ **when ready.

You should now have succesfully set up all Motif systems, and launched your application.

**To shut down everything...**

1. Shut down BladeRunner from the command-line window by pressing Ctrl+C
2. Shut down the back-end components from Cygwin by entering the following command:

   ```
   ./dfw stop
   ```

**...and that’s it!** 

You will now have completed all three parts to the FX Professional Motif deployment guide. For additional commands and information you might find useful, see below.

## Additional information

### Location of logs

The logs for each of the adapter blades can be found in _\active_blades\&lt;ADAPTER_NAME>\DataSource\var_

### Location of Adapter Configurations

Modifying an adapter blade configuration is not required as part of deploying the FX Professional Motif. However, if you do wish to access these configurations, see the following:

1. Navigate to your Deployment Framework’s root directory
2. Look under the _\active_blades_ folder. For each adapter blade in _\active_blades\&lt;NAME_OF_ADAPTER>_, you will find the following two directories:

   _\active_blades\&lt;NAME_OF_ADAPTER>\DataSource\etc\_

   _\active_blades\&lt;NAME_OF_ADAPTER>\Liberator\etc\_

For more information on changing a blade’s configuration, see [here](../../caplin-platform/deployment-framework/cdf-change-a-blades-configuration.md).

### Additional DFW commands

See this page [here](../../caplin-platform/deployment-framework/cdf-the-deployment-framework-command-utility-dfw.md).
