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.

image
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.
clip_image002
  1. On the Packages selection page, select Web Server (IIS) and any other needed then Next.
clip_image003
  • On the Destination Machine info page, specify the details for your new Nano IIS Web Server and then Next.
clip_image004
clip_image005
  • After Creating the Nano VHDX then Create a VM GEN2 in my case and startup, then login.
clip_image006
  • From the Remote system connect to the IIS default Website with the IP or name you assigned to your Nano IIS Web Server.
clip_image007
  • Connecting to your Nano Web Server via PowerShell PSSession
clip_image008
Important: You might get the following error if WinRM is not configured correctly.
clip_image009

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
clip_image010
  • 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.
clip_image011
clip_image012
clip_image013
  • 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.
clip_image014

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
clip_image015
  • Import-module IISAdministration
  • Get-IISSite to check the module importation worked as expected.
clip_image016
  • 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
clip_image017
  • Stopping the Default IIS Website and starting the new Custom Nano IIS Website
clip_image018
  • That's it now you should be able to access your new IIS website.
clip_image007[1]

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.
clip_image019
This is my new customized Nano IIS Website.
clip_image001[1]
That’s it you have now deployed a Nano IIS Web Server and Sites.

























No comments :

Post a Comment