Microsoft IIS 10.0 – Testing uploaded web pages

How to install Docker CE on CentOS 8

In this recipe, we will open the firewall port for Nano Server. We’ve already modified the port 8081 binding information for nanosite.com. We need to open the firewall port 8081 in Nano Server, which will allow us to access the website with port 8081. We will open the default.htm page, which we created through PowerShell.

Getting ready

To step through this recipe, you will need a Nano Server 2016 instance with the IIS package installed. For all this installation and configuration work, you should have administrative privileges.

How to do it…

  1. Go to the WIN2016IIS server to access Nano Server 2016. We have to first log in to the WIN2016IIS server with any Windows 2016 Server or Windows 10 machine. We will use the WIN2016IIS server to remotely connect to Nano Server on 172.16.15.63.
  2. Let’s first create the firewall rule to allow port 8081 on Nano Server. Execute RunAs /user:Administrator PowerShell_ISE.exe in the Run window on the WIN2016IIS server. It will ask you for the administrator password of WIN2016IIS. Type the administrator password and press Enter. You will get PowerShell to open with administrative rights.
  3. Next, we will write the PowerShell command Set-Item WSMan:localhost\Client\TrustedHosts -Value 172.16.15.63 -Concatenate and press the Enter button. You will get a popup for confirmation of the trusted host option. Click on Yes.
  4. Now we have to execute a PowerShell command to connect to Nano Server: Enter-PSSession –ComputerName "172.16.15.63" -Credential ~Administrator. You will get the popup for the Nano Server administrator password. Enter the password and press OK.
  5. Once Nano Server is connected to, we have to write a PowerShell command for the firewall: we will add a firewall rule to allow port 8081. Type the command New-NetFirewallRule -DisplayName "Allow Inbound Port 8081" -Direction Inbound –LocalPort 8081 -Protocol TCP -Action Allow in the PowerShell command prompt:
  1. You can see in the screenshot that the firewall Allow rule has been created. Now let’s test nanosite.com:8081 to check whether it’s working or not.

 

 

  1. Open Internet Explorer on the WIN2016IIS server, type the nanosite.com IP address, 172.16.15.63, along with the port number, 8081:
  1. As you can see, we have access nanosite.com using its IP address. If you configure the DNS, you can use the website domain name, nanosite.com.

How it works…

In this recipe, we set up a firewall rule to allow port 8081 on Nano Server. We opened the firewall port 8081 on Nano Server through PowerShell, which allows us to access the nanosite.com on port 8081. We opened the default.htm page, which we had created using PowerShell.

Comments are closed.

Microsoft IIS 10.0 – Testing uploaded web pages

How to install Ubuntu Server 19.10

In this recipe, we are going to test the website v5mysite.com, which we’ve created and configured. We will create an Allow rule on Nano Server for port 8082 in the firewall, and we will set the default page to v5mysite.htm in the Default Document setting for the website v5mysite.com . We will browse v5mysite.com and verify the default page.

Getting ready

We are going to remotely connect to Nano Server through PowerShell and use the IISAdministrator module. You will need a Windows Server 2016 virtual or physical server for remote PowerShell management of Nano Server 2016. For all this installation and configuration work, you should have administrative privileges.

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.63\c$\Windows\System32\inetsrv\config. 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.

How it works…

In this recipe, we tested the website v5mysite.com, which we created and configured. We created an Allow rule on Nano Server for port 8082 in the firewall. We set up the Default Document settings for the default page v5mysite.htm of website v5mysite.com, and we made the default page entry for v5mysite.htm at the top. We browsed the website v5mysite.com and saw the default page.

Comments are closed.