Deploying BSF

Before you start
Find out what Host name they would like to run the service on (e.g. silverlink-bsf.customerdomain.nhs.uk), ask them to setup this domain, pointing at the IP of the IIS server

Creating the Site
Remote Desktop to the server

Create new folders for the sites (I normally try to keep this out of inetpub, as it makes it easier to move the web content to a different drive). e.g: Grant Full Control to the IIS_IUSRS folder
 * d:\webroot\silverlink-bsf
 * d:\webroot\silverlink-bsf-test

Run IIS Manager

Create a new Site Go to the Application Pool
 * Give it a name (e.g. silverlink-bsf)
 * Set the Host name of the binding the required setting (e.g. silverlink-bsf.customerdomain.nhs.uk)
 * Once the site is created, open this site bindings window and add an additional binding to a free port (e.g. 5000) and IP Address 127.0.0.1 (localhost) leaving host name blank - this is useful for testing as some errors can only be seen on the server.
 * Check it is set to .NET v4.0 - if not change the setting (if there is no v4.0 option you need to install the dotnet framework v4 - download it from Microsoft or use WebPI)

Installing WebDeploy
''Right click on the site in in the IIS manager connections list. If there is already a "deploy" option you can skip this step - else you need to install/enable web deploy''

Open the Web Platform Installer (WebPI), if it isn't already installed on the machine you can download it from the Microsoft website (http://www.microsoft.com/web/downloads/platform.aspx)

Search for and install Web Deploy 3.5 without bundled SQL support (latest)

You may need to close and reopen IIS Manager for the option to appear.

Install the Site Code
For this bit you'll need the website code package Right click on the site in IIS Manager and select Deploy -> Import Application Open the site in the Browser on the server
 * You can obtain it from the build server (http://build.silverlinksoftware.com:8080/)
 * Find the build you wish to release and go to the Artifacts tab to find the zip package
 * Upload this to the server, extract it to a temporary folder (it should contain an inner zip file and a few config files)
 * Browse to the inner zip file and click Next
 * Leave all the Package components selected and click Next
 * We want to install at the site root, so blank out the Application Path field (ignore the warning about this)
 * Edit the "server name" in the Connection String parameters to point to the correct TNS name - (for connection strings other than "Connection Only" the username and password doesn't matter)
 * Click Next to complete the wizard

You may get an error due to missing windows components/setup (this can vary depending on windows/IIS version and what is already installed on the server) - ones I experienced were: HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid

This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

or  HTTP Error 500.21 - Internal Server Error
 * Solved by opening Feature Delegation in IIS Manager and setting "Handler Mappings" and "Modules" from Read Only to Read/Write

Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list HTTP Error 403.14 - Forbidden
 * Solved by opening "Turn Windows Features on and off in Server Manager" and enable "ASP.NET 4.5" under Features -> .NET Framework 4.5
 * Using WebPI install "IIS: .NET Extensibility 4.5"

The Web server is configured to not list the contents of this directory.
 * ASP.net is not kicking in and running the app
 * Solved by installing "Recommended Server Configuration for Webhosts" from webPI (deselecting everything except the main package)
 * Downloading and installing MVC4 from http://www.microsoft.com/en-us/download/details.aspx?id=30683
 * Adding the following to web.config (from http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html)

These errors can take a bit of googling, but eventually you should get something that looks like a website - this is progress.

Try logging in (or doing an activity requiring data) you'll probably get an error saying that it can't connect to the database (unless the Oracle client is already configured)

Setting up the database connection
Download the Oracle Instant Client. The website will use the version that the IIS process is running in (probably x64) but it may be worth installing both incase anything else is installed on this server.

Download both the x64 and 32bit versions and unzip them to a folder.

Setup a symlink from System32 to the 64bit version and from SysWOW64 to the 32bit version (http://realfiction.net/2009/11/26/Use-32-and-64bit-Oracle-Client-in-parallel-on-Windows-7-64-bit-for-eg-NET-Apps/) but opening a command prompt as Administrator Create the ORACLE_HOME environment variable and set it to C:\Windows\System32\instantclient_12_1
 * C:\Windows\system32>mklink /d instantclient_12_1 C:\Oracle\instantclient_12_1_x64
 * symbolic link created for instantclient_12_1 <<===>> C:\Oracle\instantclient_12_1_x64
 * C:\Windows\system32>cd ..
 * C:\Windows>cd SysWOW64
 * C:\Windows\SysWOW64>mklink /d instantclient_12_1 C:\Oracle\instantclient_12_1_32bit
 * symbolic link created for instantclient_12_1 <<===>> C:\Oracle\instantclient_12_1_32bit

Add C:\Windows\System32\instantclient_12_1 to the PATH

Add a tnsnames.ora file and sqlnet.ora file to each of the instant client folders, and a TNS_ADMIN environment variable to point to C:\Windows\System32\instantclient_12_1

The dotconnect library also requires a Registry setting for oracle home Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE] "ORACLE_HOME"="C:\\Windows\\System32\\instantclient_12_1" @="" "ORACLE_HOME_NAME"="OraHome" "ORACLE_GROUP_NAME"="Oracle -  OraHome" [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES] "HOME_COUNTER"="1" "DEFAULT_HOME"="OraHome" "LAST_HOME"="0" @="" [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES\ID0] "NAME"="OraHome" "PATH"="C:\\Windows\\System32\\instantclient_12_1" [HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0] "ORACLE_HOME"="C:\\Windows\\System32\\instantclient_12_1" "ORACLE_SID"="ORCL1210" "ID"="0" "ORACLE_GROUP_NAME"="Oracle -  OraHome" "ORACLE_HOME_NAME"="OraHome" "ORACLE_HOME_KEY"="Software\\ORACLE\\HOME0"