You can host MDrivenServer and MDriven Turnkey Core on Windows IIS when you need an on-premise Turnkey environment managed by IIS.
Choose an IIS layout
MDriven Turnkey is the user-facing application. MDrivenServer stores and serves the model and is used when you upload and evolve the model from MDriven Designer.
For an on-premise Turnkey installation, host Turnkey as an IIS application and host MDrivenServer below it as an IIS application named __MDrivenServer (two underscore characters). For example:
https://server.example/MyTurnkeyApp/
https://server.example/MyTurnkeyApp/__MDrivenServer/
This layout keeps the Turnkey application and the Server it uses under the same IIS site. Configure HTTPS before configuring Turnkey: the internal communication requires a certificate that is valid for the URL in use. A self-signed certificate must be issued to the server machine name, and you must access the site by that certificate name to avoid certificate errors.
| Component | IIS application path example | Purpose |
|---|---|---|
| MDriven Turnkey | /MyTurnkeyApp
|
Serves the Turnkey web application. |
| MDrivenServer | /MyTurnkeyApp/__MDrivenServer
|
Hosts the model, users, and MDrivenServer administration. |
Do not rename __MDrivenServer. The name contains two leading underscores.
Before you start
- Use a Windows server on which you have administrative access.
- Install IIS and the ASP.NET Core Hosting Bundle required by the Core packages you deploy. In IIS Manager, confirm that the
AspNetCoreModuleV2module is available after installation. - Install and configure IIS HTTPS bindings and a certificate. The IIS binding URL is also used in the Core command-line override configuration.
- Download the current Windows packages for both MDrivenServer and MDriven Turnkey from MDriven Downloads.
- If you use IIS Import Application, install Web Deploy with IIS Deployment Handler. This IIS feature provides the import option.
For IIS role services, legacy MDriven Server installation details, WCF requirements, and certificate guidance, see HowTos:Installing MDriven Server on Windows. If you are moving an existing application from .NET Framework, complete the backup and migration planning in Documentation:Migrating From MDriven .NET Framework to .NET Core first.
Create the IIS site and application pool
- Open IIS Manager.
- Create or select the IIS website that will contain the Turnkey application. Configure its HTTPS binding and select the certificate that matches the hostname users will enter.
- Create a dedicated application pool, for example
MDrivenTurnkeyAppPool. - In the application pool settings, set .NET CLR version to No Managed Code and use the Integrated pipeline.
- In the application pool Advanced Settings, set Start Mode to
AlwaysRunning. Choose an identity appropriate for your environment. - Add the Turnkey application, for example
MyTurnkeyApp, under the website and assign it to this application pool. - Add a second application below the Turnkey application named exactly
__MDrivenServer. Assign it to an application pool. You can use a separate pool to isolate the Server from Turnkey.
Using separate application pools is recommended for isolation. If multiple sites run on the server, review the memory and recycle settings described in HowTos:Installing MDriven Server on Windows.
Deploy the application packages
- Import or extract the MDriven Turnkey package into the physical folder for
MyTurnkeyApp. - Import or extract the MDrivenServer package into the physical folder for
MyTurnkeyApp/__MDrivenServer. - If you use Import Application and created the IIS application structure first, leave the import dialog's application path field empty. This preserves the required folder and application structure.
- When updating an existing installation, retain the existing database. The deployment package does not overwrite it. Follow your change-control and backup process before replacing application files.
Grant file permissions
The application runs as its IIS application-pool identity when it accesses the file system. Grant that identity read and write access to each application folder it operates:
- Grant the Turnkey application pool identity access to the Turnkey application folder.
- Grant the MDrivenServer application pool identity access to the MDrivenServer application folder, including its
logsdirectory.
For example, if the Server pool is named MDrivenServerAppPool, grant the folder permission to IIS AppPool\MDrivenServerAppPool. MDrivenServer needs write access for logs and application data; it also uses the application user's temporary folder when extracting model assets and assemblies. See Documentation:AppPool user for the application-pool identity and permission details.
Configure the Core applications
Core packages hosted by IIS require an exactly named CommandLineOverride.xml file in the App_Data folder of both applications.
| Application | Required path | What it configures |
|---|---|---|
| MDrivenServer | MyTurnkeyApp/__MDrivenServer/App_Data/CommandLineOverride.xml
|
The command-line arguments used when IIS starts MDrivenServer, including its URL. |
| MDriven Turnkey | MyTurnkeyApp/App_Data/CommandLineOverride.xml
|
The command-line arguments used when IIS starts Turnkey, including its URL. |
| MDriven Turnkey | MyTurnkeyApp/App_Data/MDrivenServerOverride.xml
|
The MDrivenServer URL and the credentials Turnkey uses to connect to it. |
| MDriven Turnkey | MyTurnkeyApp/App_Data/TurnkeySettingsOverride.xml
|
Turnkey settings that must persist when application files are upgraded. |
Use the configuration templates and values supplied with the current package for these files. File names and paths are significant. Do not change spelling, extension, or the App_Data location.
The application URL in each CommandLineOverride.xml must match the IIS binding URL for that application. For example, if the Turnkey IIS binding is https://server.example and Turnkey is installed as /MyTurnkeyApp, configure the Turnkey URL with that same externally used URL and application path. A mismatch between the binding and override URL prevents IIS-hosted Core applications from starting or communicating as expected.
Initialize MDrivenServer and connect Turnkey
- Browse to the MDrivenServer application URL, for example
https://server.example/MyTurnkeyApp/__MDrivenServer/. - On first access, MDrivenServer creates and initializes its expected database when it does not already exist.
- Register a user for Server administration and model work. Do not use the user reserved for Turnkey where your package configuration uses one.
- Sign in to MDrivenServer and open user administration.
- Create or select the account that MDriven Turnkey will use, then enter its URL and credentials in
App_Data/MDrivenServerOverride.xmlin the Turnkey application. - For a secured installation, assign administrative users the
SuperAdminrole. In user administration, enable Admin require Identification and Services require identification, then enable Turn off registration. Record administrator passwords before turning registration off; otherwise you can lock yourself out. - Browse to the Turnkey URL, for example
https://server.example/MyTurnkeyApp/, and verify that it connects to MDrivenServer. - Upload the model to MDrivenServer from MDriven Designer.
If registration has been disabled and all administrative credentials are lost, locate __MDrivenServer/App_Data/DatabaseCompact.sdf. Using SQL Server Compact tools, set admin_GlobalSettings.TurnOffRegistration to 0 (false), register a new user, and then restore the intended security settings.
Verify the deployment
Check these items before handing the site to users:
- The HTTPS certificate matches the hostname used in the browser and in application configuration.
- Both IIS applications start under the intended application-pool identities.
- MDrivenServer opens at the
__MDrivenServerpath. - Turnkey opens at its application path and authenticates to MDrivenServer.
- The Server and Turnkey application-pool identities can write to their required application data and log folders.
- A model uploaded from MDriven Designer is available through Turnkey.
Troubleshoot IIS startup and connectivity
HTTP Error 500.30: ANCM In-Process Start Failure
This error commonly means that IIS cannot start the ASP.NET Core application.
- Install or repair the appropriate ASP.NET Core Hosting Bundle, then restart IIS.
- In IIS Manager, check Modules and confirm that
AspNetCoreModuleV2is listed. If it is absent, the Hosting Bundle is not installed correctly. - Verify that the application pool uses No Managed Code.
- Verify read and write access for the application-pool identity. For diagnosis, grant the identity sufficient access to the application folder and then apply the least privileges that allow the application to run.
- Check that
App_Data/CommandLineOverride.xmlexists in both applications, has its exact name, and specifies the matching IIS URL.
Turnkey cannot connect to MDrivenServer
- Confirm that
App_Data/MDrivenServerOverride.xmlexists in the Turnkey application and contains the correct Server URL and credentials. - Confirm that the Server application is named
__MDrivenServerand is configured as an IIS application, not only as a folder. - Confirm that HTTPS is configured and that the Server certificate is valid for the URL that Turnkey uses.
- Verify the Server account, password, and user-administration restrictions.
Where to find diagnostics
Check the Windows Event Viewer Application log and IIS logs first. Also check the application logs directories, including the MDrivenServer __MDrivenServer/logs directory. After correcting configuration or hosting changes, run iisreset from an elevated command prompt when an IIS restart is required.
