How to do it...

  1. We have created the application pool NanoAPP and assigned it to the website v5mysite; we haven't yet made the ASP.Net configuration on IIS Server. We will test the application pool in the next chapter. Let's remove the entry of the application pool in v5mysite.

 

 

  1. Log in to Windows Server 2016. The IP of Windows Server 2016 is 172.16.15.60 and the name of the server is WIN2016IIS. Press Windows + R on your keyboard, and you will get the Run window. Type the following address: \172.16.15.63c$WindowsSystem32inetsrvconfig. When accessing the Nano Server IIS configuration folder, you will find the filename ApplicationHost.config, as shown here:
  1. As shown in the screenshot, we removed the application name. Now you have to save the ApplicationHost file and close it. Let's open the PowerShell command prompt.
  2. We have to open PowerShell ISE with administrative rights and run RunAs /user:Administrator PowerShell_ISE.exe in the Run command window. Now it will ask you the administrator password for your Windows Server 2016 instance (not Nano Server). Type the administrator password and press Enter. The PowerShell window will open.

 

 

  1. Now we have to remotely connect to Nano Server 2016 on 172.16.15.63. Run the following command: Enter-PSSession –ComputerName "172.16.15.63" -Credential ~Administrator
  2. Now you will get a pop-up window for the Nano Server administrator account password. Enter the Nano Server administrator password and press OK to log in. Now you have connected successfully.
  3. Write the command Import-module iisAdministration in PowerShell and press Enter. You will get the PowerShell module imported. You have successfully finished the remote connection setup and imported the PowerShell module to Nano Server IIS.
  4. You know that we have created a website called v5mysite with the default port number 8082. If we try to open v5mysite, it will not open because the Nano Server default allowed IIS ports are 80 and 443. So we have to first open the firewall port for v5mysite. Run the following command in PowerShell:
New-NetFirewallRule -DisplayName "Allow Inbound Port 8082" -Direction Inbound –LocalPort 8082 -Protocol TCP -Action Allow
  1. We've created a firewall rule called Allow Inbound Port 8082.
  2. Open Internet Explorer and type the URL http://172.16.15.63:8082/, as shown here:
  1. As you can see in the screenshot, we get the webpage index.htm as the default page of v5mysite. Now we have to set up the Default Document to access the default page, v5mysite.htm.
  2. We have to remove the existing default document entry v5mysite.htm, which we made earlier, in order to remove the existing default document filename. Type the following command in PowerShell:
"Get-IISConfigSection -SectionPath "system.webServer/defaultDocument" | Get-IISConfigCollection -CollectionName "files" | Remove-IISConfigCollectionElement -ConfigAttribute @{value = "v5mysite.htm"}", 

Once we run this command, a confirmation popup window will appear, as shown here:

  1. Click on Yes. Now you have to create a new entry for v5mysite.htm in the Default Document settings. Type the following command in PowerShell:
Get-IISConfigSection -SectionPath "system.webServer/defaultDocument" | Get-IISConfigCollection -CollectionName "files" | New-IISConfigCollectionElement  -ConfigAttribute @{Value = "v5mysite.htm"} -AddAt 0
  1. Let's test the website v5mysite.com and check the default page. Open Internet Explorer and type the URL http://172.16.15.63:8082/:
  1. Here you can see that the website opens the default page, v5mysite.htm.
..................Content has been hidden....................

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