Nano Server - How to deploy IIS Web Services Role on Nano Server 2016 and create custom IIS websites step by step

No comments

How to deploy IIS Web Services Role on Nano Server 2016 and create custom IIS websites step by step.

On this tutorial I'm going to be using Nano Server Image builder (Here's a post on how to install) and Windows 10 Hyper-V as my virtualization host. I will cover the Nano Server image creation, deployment and management.

Step by Step

  • On the Nano Server Image builder select Create a new Nano Server image and then continue to the packages selection.
  1. On the Packages selection page, select Web Server (IIS) and any other needed then Next.
  • On the Destination Machine info page, specify the details for your new Nano IIS Web Server and then Next.
  • After Creating the Nano VHDX then Create a VM GEN2 in my case and startup, then login.
  • From the Remote system connect to the IIS default Website with the IP or name you assigned to your Nano IIS Web Server.
  • Connecting to your Nano Web Server via PowerShell PSSession
Important: You might get the following error if WinRM is not configured correctly.

How to Configure WinRM and enable Nano Server Remote Management

  • winrm quickconfig
  • winrm set winrm/config/client @{TrustedHosts="NanoServerIP"}
  • chcp 65001
Now you should be able to execute commands remotely on the Nano Server. F
  • winrs -r:NanoServerIP -u:Administrator -p:Password ipconfig
  • Managing via the Server Manager Console, All Servers, right click on the new server and Manage As… (`\Administrator and Password) then Ok and the server should come up. After discovering the services you will be able to manage the installed roles/services.
  • Now you should be able to manage your Nano IIS Web Server and also install more features to the IIS role if required. In this demo I have installed some extra features so I can customize and utilize other features.

Creating a new IIS Website on Nano Server via PowerShell

Before creating the website make sure you have an active connection to the Nano Server. In my case it’s a bit different because is a workgroup machine, if you have it in a domain is much easier.
  • Connect via PowerShell to your Nano IIS Web Server
  • Import-module IISAdministration
  • Get-IISSite to check the module importation worked as expected.
  • To create the new site use the following command line:
Important: if you a creating a new site that will utilize the port 80 then you will need to either stop or delete the default IIS site.
New-IISSite -Name "NanoWebSite" -bindinginformation "*:80:" -PhysicalPath C:\Inetpub\yourpath
  • Stopping the Default IIS Website and starting the new Custom Nano IIS Website
  • That's it now you should be able to access your new IIS website.

Customizing your new website

You could customize the site contents by utilizing the Copy-Item PowerShell Command line or the Windows Explorer and copy your custom HTML/CSS files.
This is my new customized Nano IIS Website.
That’s it you have now deployed a Nano IIS Web Server and Sites.

No comments :

Post a Comment