How to: Set Up Multiple Web Server Instances for the Microsoft Dynamics NAV Web Client – Part 1

No, you guessed wrong! I am not going to add another blog to explain how to use Powershell to create and setup a Dynamics NAV Web Instance.

As a quick reminder you can refer to msdn here and use Microsoft Dynamics NAV Administration Shell to easily create a new web instance.

But what if I cannot use Microsoft Dynamics NAV Administration Shell? Yes, now you guessed right. This is the reason behind this blog post.

Scenario (summary in three points):

  • You installed NAV Server and Web Server on separate machines.
  • In your NAV Server you can locate Microsoft Dynamics NAV Administration Shell.
  • In your Web Server you cannot locate Microsoft Dynamics NAV Administration Shell.

You quickly notice that you cannot apply what msdn says, because simply you do not have Microsoft Dynamics NAV Administration Shell installed on your Web Server.

What is the solution then? From my side, I explored two options:

  1. Powershell remote session from NAV Server to Web Server and apply the New-NAVWebServerInstance,
  2. Build a Web Instance from scratch.

I quickly dropped the first option due to network and firewall issues and because the second option sounds more fun 😉

So, let’s build that web instance.

To achieve that, open your IIS and locate the default Web Instance, “DynamicsNAV90” in my case.

iis_web_client

It is easy now. You just must create the same structure (I highlighted the important parts).

  • Create a virtual directory,
  • Give it a name: MyWebClient
  • Point the physical path to a folder: “C:\inetpub\wwwroot\MyWebClient”
virtual_directory

Now, execute this command line as administrator:

mklink /d “C:\Inetpub\wwwroot\MyWebClient\WebClient” “C:\Program Files\Microsoft Dynamics NAV\90\Web Client”

This will create a symbolic link to the “C:\Inetpub\wwwroot\MyWebClient\WebClient” that points to “C:\Program Files\Microsoft Dynamics NAV\90\Web Client”.

Then, copy the “web.config” from the default web instance and past it to MyWebClient (Change the web.config to point to another NAV Server if needed):

webconfig

Now, create the following folder “C:\ProgramData\Microsoft\Microsoft Dynamics NAV\90\Web Client\MyWebClient\WebClient\Resources\ExtractedResources” and assign the following permissions to IIS_IUSRS:

ExtractedResorces

Create a Virtual Directory that points to the folder we just created:

ExtractedResorces_virtualdirectory

Last step, convert “WebClient” to an application:

application

Now, try to connect to your new and freshly created web site http://localhost:8080/MyWebClient/WebClient/

P.S1: in this blog, I used NAV 2016 as an example. But the same apply to all NAV versions with a web client.

P.S2: I used default installation folder. You may need to adapt this for your test.

P.S3: You try this trick on your own risk.

P.S4: I’ll let you play with it and create the whole web site from scratch 😉

This blog is available also on Microsoft Dynamics NAV Community

7 thoughts on “How to: Set Up Multiple Web Server Instances for the Microsoft Dynamics NAV Web Client – Part 1”

  1. Pingback: How to: Set Up Multiple Web Server Instances for the Microsoft Dynamics NAV Web Client – Part 2 | NAV NAB BLOG

  2. I got a 500 error until I also added the Thumbnails folder to the resources folder set up earlier, this was for Dynamics Nav 100, 2017

    1. Hi Steve,

      Thanks for the tip. From my side, I already tried with NAV 2017, 2016, 2015, 2013 R2 and 2013 (standard databases). All of them worked well. I also tried on different machines.

      If you can give more details we can, maybe, understand what happens on your side.

  3. Pingback: How to: Set Up Multiple Web Server Instances for the Microsoft Dynamics NAV Web Client – Part 2 - Microsoft Dynamics NAV Community

  4. Thanks for your solution

    Same issue as Steve with Nav 2017 and Windows Server 2016
    Exception type: DirectoryNotFoundException …Thumbnails

    Added these lines to your script and new site instance worked like a charm

    mkdir ‘C:\ProgramData\Microsoft\Microsoft Dynamics NAV\100\Web Client\{MyWebClient]\WebClient\Thumbnails’
    cmd /c icacls ‘C:\ProgramData\Microsoft\Microsoft Dynamics NAV\100\Web Client\{MyWebClient]\WebClient\Thumbnails’ /grant ‘IIS_IUSRS:(OI)(CI)(RX,W)’

  5. Pingback: How to create new web client site and bind it to another certificate - Microsoft Dynamics NAV Community

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top