How to do it...

  1. Log in to Windows Server 2016. The IP is 172.16.15.60 and the name of the server is WIN2016IIS. Press Windows + R. You will get the Run window. Open PowerShell ISE with administrative rights, type RunAs /user:Administrator PowerShell_ISE.exe, and press OK.
  2. Now it will ask you the administrator password for your Windows Server 2016 (not Nano Server) machine. Type it and press Enter. You will get the PowerShell window.
  3. Now we have to remotely connect to Nano Server 2016 at IP 172.16.15.63. Run the command Enter-PSSession –ComputerName "172.16.15.63" -Credential ~Administrator. Now you will get a popup window for the Nano Server administrator account password. Enter the Nano Server administrator account password and press OK to log in. You have connected successfully. Now write the command Import-module iisAdministration and press Enter. This will import the PowerShell module.
  4. Now let's create a website called NanoAspnet. Type New-IISSite -Name "NanoAspNet" -PhysicalPath c:inetpubwwwroot -BindingInformation "*:8000:" and run it. The website will be created.
  5. Now let's check whether NanoAspnet has been created or not. Type Get-IISsite, as shown here:
  1. You can see from the screenshot that we have created the website NanoAspNet with port 8000. Now let's create the virtual directory MyApp on NanoAspNet. First, we have to create a physical directory (folder on Nano Server) that we can use for the virtual directory. We create a directory called MyApp under C:inetpubwwwroot, as shown here:
  1. Now open PowerShell, which is already connected with our Nano Server instance, and type the following command to create a virtual directory:
      $manager = Get-IISServerManager $app = 
$manager.Sites["NanoAspNet"].Applications.Add
("/MyApp",
"c:inetpubwwwrootMyApp")$manager.CommitChanges()
  1. You have successfully created the MyApp virtual directory for NanoAspNet.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.223.123