loading...

Microsoft IIS 10.0 – Creating an advanced IIS 10.0 website on Nano Server

How to find files and file listing on ubuntu

In this recipe, we will create a website with a website header (website name) and also add an application pool. We will create a separate application pool and add the application pool to our website. We will find all the available listed application pools in IIS Server.

Getting ready

We are going to remotely connect Nano Server through PowerShell and manage IIS over 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. Log in to Windows Server 2016. The IP address of Windows Server 2016 is 172.16.15.60 and the name of the server is WIN2016IIS.
  2. Press Windows + R on your keyboard. You will get the Run window. Open PowerShell ISE with administrative rights, type RunAs /user:Administrator PowerShell_ISE.exe in the Run window, and press OK.
  3. Now it will ask you the administrative password for you Windows Server 2016 instance (not Nano Server). Type the administrator password and press Enter. The PowerShell window will open.
  4. Now we have to remote-connect to Nano Server 2016 on the IP 172.16.15.63.
  5. We will use the following command from PowerShell:

Enter-PSSession –ComputerName "172.16.15.63" -Credential ~\Administrator
You can use either the computer name or IP address for –ComputerName. We are using the IP address in this command.
  1. Now you will get a pop-up window for the Nano Server administrator username and password. We will enter the Nano server administrator password and press OK to log in. You have connected successfully. Run the Import-module iisAdministration command. Press Enter and you will get the PowerShell module imported.
  2. Let’s create the website with an advanced script. We will use the following command:

$manager = Get-IISServerManager 
$site = $manager.Sites.Add("v5mysite", "http", "*:8082:v5mysite.com", "C:\v5mysite") $site.Id = 4                           $site.Bindings.Add("*:8083:", "http")$manager.CommitChanges()"

  1. Close PowerShell and press Enter. We can run the command from the PowerShell toolbar by clicking on the Play button at the top:
  1. You can see here that we created a website called v5mysite with protocol http , IP * (all available IPs), and header v5mysite.com . We also set the physical path of v5mysite as C:\v5mysite and set the site ID as 4.

 

 

  1. Now let’s check the created website, v5mysite . Run the command Get-IISSite in PowerShell:
  1. You’ll see in the figure that it shows that you have a website called v5mysite, ID 4, status Started, and physical path C:\v5mysite, and we have two pieces of binding information, one with the header and the other without.
  2. Let’s create the application pool in IIS 10.0 on Nano Server. Run the following command in PowerShell:

$manager = Get-IISServerManager $pool = $manager.ApplicationPools.Add("NanoAPP") $pool.ManagedPipelineMode = "Integrated" $pool.ManagedRuntimeVersion = "v4.0" $pool.Enable32BitAppOnWin64 = $false $pool.AutoStart = $true $pool.StartMode = "OnDemand" $pool.ProcessModel.IdentityType = "ApplicationPoolIdentity" $manager.CommitChanges()

 

 

  1. Next, we create an application pool called NanoApp and set the property of the application pool, as shown here:
  1. Once you create the application pool, you can check its status with the command Get-IISAppPool, as shown here:
  1. You can see that we have created the application pool called NanoApp . Let’s add NanoApp to v5msite.com . Use the following command:

\$manager = Get-IISServerManager $website = $manager.Sites["v5mysite"] $website.Applications["/"].ApplicationPoolName = "NanoApp" $manager.CommitChanges()
  1. We assigned the application pool NanoApp to website v5mysite. Now let’s check the application pool name for v5mysite.com.
  2. Use the following command:

"$manager = Get-IISServerManager
$website = $manager.Sites["v5mysite"]
$website.Applications["/"].ApplicationPoolName"

 

 

  1. You will get the application pool name as NanoAPP, as shown here:

How to do it…

In this recipe, we remotely connected to Nano Server with a PowerShell command and imported the IIS module through IISAdministrator. We created the website v5mysite with website header v5mysite.com. We created a separate application pool called NanoAPP and added it to our website, v5mysite and found all the listed available application pools in IIS Server using a PowerShell command.

Comments are closed.

loading...