Set up MDriven Turnkey on premise

There can be several reasons for running the MDriven Turnkey software on premise rather than in the cloud - and it is easy to achieve.

To run MDriven Turnkey on your own IIS, do the following:

1. Create a new IIS application:

Turnkey on premise image 1.png

2. Download these application packages, MDriven Server and MDriven Turnkey:

Turnkey on premise image 2.png

3. Make sure you understand how to make the IIS server use https and how you can either self-sign or acquire your own certificate. This is key for making the internal WCF communication in MDriven Turnkey work.

4. Import the Application Package for MDriven Turnkey into your IIS app:

Turnkey on premise image 3.png

Turnkey on premise image 4.png

Turnkey on premise image 5.png

Turnkey on premise image 6.png

Now import the package for MDriven Server into your first application:

Turnkey on premise image 7.png

Name the application __MDrivenServer – with two underscores:

Turnkey on premise image 8.png

In the end, you will have this:

Turnkey on premise image 9.png

Configure for https (not described in this book – IIS-specific knowledge)

Notice the __MDrivenServer/logs catalog; things will work better if your application can access this. Find it in File Explorer and give read/write access to “IIS AppPool\NameOfTheAppPool”.

To configure your system navigate to the __MDrivenServer application: https://localhost/MyMDrivenTurnkeyApp1/__MDrivenServer/

You should see this:

Turnkey on premise image 10.png

This is the server’s response to not finding the expected database. It creates it and sets things up to the best of its ability. Click Index to go back to the default page:

Turnkey on premise image 11.png

We are prompted with a login – but we need to register a user that the MDriven Turnkey app will use to access the MDriven Server. You will also want to access the MDriven Server in order to upload and evolve models – so create a user “b” and remember the password:

Turnkey on premise image 12.png

Now, log into MDriven Server with this user:

Turnkey on premise image 13.png

In the admin area, choose user admin:

Turnkey on premise image 14.png

In UserAdmin, you can control the existing users on your MDrivenServer – we need an account to be used by your Turnkey site.

To tighten security for our MDrivenServer, we are going to:

  1. Assign the users we want to have access to the role SuperAdmin
  2. Check the box for Admin require Identification
  3. Check the box for Services require identification

Check the box for Turn off registration:

Turnkey on premise image 15.png

This way, we will enforce user identification and turn off the ability to register as a new user. It is important that you remember the password for the users you have – otherwise, you will be locked out.

When you have accidentally locked yourself out, you can find the admin database, and open it with SqlServerCompact tools. Find table admin_GlobalSettings and set column TurnOffRegistration to 0 (false). Now, you may register a new user and regain control.

Turnkey on premise image 16.png

The database is located in __MDrivenServer\App_Data\DatabaseCompact.sdf

Now the MDrivenServer is fully configured and we will look at the MDriven Turnkey application that will use it.

Pointing our browser at the Turnkey application will give us this: https://localhost/MyMDrivenTurnkeyApp1

Turnkey on premise image 17.png

The reason is that the Turnkey application expects to find a file with information about what user and password to use to access __MDrivenServer. The file should be in the App_Data folder and its name must be TurnkeySettings.xml. 

Turnkey on premise image 18.png

As we see, there is a template file “TurnkeySettings – NotInEffect.xml” – copy this and name it “TurnkeySettings.xml”

This file is normally managed from the LicenseAndTicket website – but since we are now installing Turnkey locally, the LicenseAndTicket has no access to help us with this. We need to edit it manually.

Open the file and fill in the username and password you picked for MDriven:

Turnkey on premise image 19 .png

Once this is done, we try our app again (you must restart your app-pool so that the file is re-read):

Turnkey on premise image 19.png

When we use MDriven Designer, we will also need to enter the address to our MDriven Server manually – so skip the first login page and go to the second page:

Turnkey on premise image 20.png

Turnkey on premise image 22.png

We must fill in the user and password that has access to MDriven Server. We need to say it is slot A0 and check “Automated Deploy” – that means an upload of the model is automatically deployed. The server address is the same one we use to access MDriven Server: https://localhost/MyMDrivenTurnkeyApp1/__MDrivenServer

And now we have everything set up to run the development loop or production in-house – nothing on in the cloud.

To update the site with fresh binaries for MDriven Turnkey or MDriven server, we can simply reapply fresh packages from the build server. 

Turnkey on premise image 4.png

Turnkey on premise image 24.png

Just make sure to choose “Append files” – because if you “delete”, you will lose the settings we just set up and the database with any models.

Turnkey on premise image 25.png

The MDriven Book - See: MDriven Turnkey Architecture

This page was edited 159 days ago on 06/17/2024. What links here