Nano Server - How to deploy IIS Web Services Role on Nano Server 2016 and create custom IIS websites step by step
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.
- 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.
- Continue to the Confirmation and Create Image and then deploy the Nano IIS Web Server VM into your Virtualization Host. (More Details here: Creating a Generation 2 VM for Nano Server on Hyper-V 2016 step by step.)
- 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
- 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:
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.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment