You can host an MDriven Turnkey application and its MDriven Server on your own Windows IIS server when you need the complete development loop or production environment to remain on premises.
What you install
This setup places both applications under one IIS application:
| Component | IIS location | Purpose |
|---|---|---|
| MDriven Turnkey | The root application, for example /MyMDrivenTurnkeyApp1
|
Serves the Turnkey web application. |
| MDrivenServer | A nested IIS application named __MDrivenServer, for example /MyMDrivenTurnkeyApp1/__MDrivenServer
|
Stores and deploys models and provides the service used by Turnkey and MDriven Designer. |
The __MDrivenServer name is required. It starts with two underscores.
Before you begin
Prepare the following:
- A Windows server with IIS and permission to create applications and configure an application pool.
- HTTPS for the IIS site. Configure a certificate that clients can trust, either a certificate you acquire or a self-signed certificate for an appropriate internal use case. HTTPS is required for the internal WCF communication used by MDriven Turnkey.
- The current MDriven Turnkey and MDriven Server application packages from MDriven downloads. You need both packages.
- An IIS application name. This guide uses
MyMDrivenTurnkeyApp1as an example; substitute your own application name consistently.
For the current IIS/Core deployment guidance, see Documentation:Deploying MDriven Server & Turnkey Core on IIS. This page describes the on-premises layout and the initial configuration that connects Turnkey, MDrivenServer, and MDriven Designer.
Create the IIS application layout
- In IIS, create a new application for MDriven Turnkey. In this example, the application URL is
https://localhost/MyMDrivenTurnkeyApp1. - Import the MDriven Turnkey application package into this root IIS application.
- Under that application, create or import a second IIS application named
__MDrivenServer. - Import the MDriven Server application package into
__MDrivenServer. - Confirm that
__MDrivenServeris configured as an IIS application, not only as a directory. - Configure HTTPS for the site and verify that the nested server URL resolves:
Grant MDrivenServer access to its log folder
MDrivenServer writes logs under __MDrivenServer/logs. Give the IIS application pool identity read and write permission to that folder.
- Locate the
__MDrivenServer/logsfolder in File Explorer. - Identify the application pool used by the IIS application.
- Grant read/write access to
IIS AppPool\NameOfTheAppPool, replacingNameOfTheAppPoolwith the actual pool name.
Without this access, the application may run with reduced logging or encounter file-access problems.
Initialize and secure MDrivenServer
- Browse to
https://localhost/MyMDrivenTurnkeyApp1/__MDrivenServer/. - On first access, MDrivenServer may report that its expected database is not present. It creates the database and performs its initial setup.
- Select Index to return to the default page.
- Register a user and retain its password. You need a user for MDrivenServer administration and an account that the Turnkey application can use to access MDrivenServer.
- Sign in to MDrivenServer with the registered user.
- In the administration area, select UserAdmin.
Restrict registration and service access
After you have confirmed that you can sign in with an administrator account, configure UserAdmin as follows:
- Assign the users that must administer MDrivenServer to the SuperAdmin role.
- Select Admin require Identification.
- Select Services require identification.
- Select Turn off registration.
These settings require identification for administration and services and prevent new self-registration. Record the credentials for every administrator before selecting Turn off registration; otherwise, you can lock yourself out.
Recover access if registration was disabled
If all usable administrator credentials are lost after registration is disabled:
- Locate
__MDrivenServer\App_Data\DatabaseCompact.sdf. - Open the database with SQL Server Compact tools.
- In the
admin_GlobalSettingstable, setTurnOffRegistrationto0(false). - Register a new user, sign in, and restore the required administration settings.
Connect Turnkey to MDrivenServer
When you browse to the root Turnkey application before it is configured, for example https://localhost/MyMDrivenTurnkeyApp1, it cannot connect because it does not yet know which MDrivenServer account to use.
Configure the required settings file:
- Open the Turnkey application's
App_Datafolder. - Find
TurnkeySettings - NotInEffect.xml. - Copy the file and name the copy
TurnkeySettings.xml. The file name must match exactly. - Open
TurnkeySettings.xmland enter the MDrivenServer user name and password that Turnkey will use. - Restart the IIS application pool. Turnkey reads the settings file when the application starts.
- Browse again to the Turnkey root URL and confirm that it loads.
In a locally installed setup, this file is maintained manually. It is normally managed through the LicenseAndTicket website for sites that use that service.
Connect MDriven Designer for model deployment
Configure MDriven Designer to use the on-premises MDrivenServer rather than the first login page's default flow.
- Skip the first login page and open the second configuration page.
- Enter the MDrivenServer user name and password.
- Set the slot to
A0. - Select Automated Deploy. With this selected, an uploaded model is deployed automatically.
- Enter the MDrivenServer URL. For the example installation, use:
https://localhost/MyMDrivenTurnkeyApp1/__MDrivenServer
You can now upload and evolve models through the on-premises MDrivenServer. The Turnkey application uses the deployed model to serve the application. A Turnkey site requires an Index ViewModel; see Documentation:Set up new Turnkey site.
Update the installed binaries
To update MDriven Turnkey or MDrivenServer binaries, reapply the corresponding current application packages.
When importing an update, choose Append files. Do not choose an option that deletes existing files. Deleting files can remove the settings you created and the MDrivenServer database that contains models.
Preserve at least these installation-specific items during updates:
- The Turnkey
App_Data\TurnkeySettings.xmlfile. - The MDrivenServer database at
__MDrivenServer\App_Data\DatabaseCompact.sdf. - Any required application data and configuration files.
Verify the installation
Use this checklist after initial configuration or an update:
- The root URL opens the Turnkey application:
https://localhost/MyMDrivenTurnkeyApp1. - The nested URL opens MDrivenServer:
https://localhost/MyMDrivenTurnkeyApp1/__MDrivenServer/. - You can sign in to MDrivenServer with an administrator account.
- The IIS application pool can write to
__MDrivenServer/logs. - MDriven Designer connects to the nested MDrivenServer URL and can deploy to slot
A0. - The deployed model includes an Index ViewModel.
