Welcome to Leap Year 2016. Have you ever wonder where is IIS 9.0 or 9.5? I do not know but it looks like 10 is Microsoft’s favourite number. Therefore, I’m introducing IIS 10.0 on Nano Server. Let us begin the journey with the deployment of IIS on Nano Server to basic IIS capability in creating a multiple new web sites on the Nano Server.
You can either view this article from the Microsoft TechNet Wiki which may have any improvement updates by the TechNet community on the link below;
Or carry on reading this page on the original article which I have noted in my engineering journal with some explanations on the process.
The Original TechNet Wiki Article on Nano Server: Building an Internet Information Services (IIS) Web Server
Introduction
In this article, we will demonstrate deploying an Internet Information Services (IIS) role on a Windows Server 2016 Technical Preview 4 Nano Server. Taking the advantage of Nano Server being a dedicated web server with a small disk footprint that is born in the cloud for the cloud.
Preparation of IIS for Nano Server Image
Joining Domain with Harvested BLOB
:: Harvest Machine (WS16TP4NSIIS1) Domain (naboo.co.nz) Join Blob from Domain Controller (WS16TP4ADDS1) djoin /Provision /Domain naboo.co.nz /Machine WS16TP4NSIIS1 /SaveFile WS16TP4NSIIS1.djoin
Copy the *.djoin file to your NanoServer folder
Getting Started with Nano Server (IIS and Domain Joined) Creation
In this example, we will create a Nano Server with IIS package that is joined to the Domain for DNS URL resolution capability.
# Import New-NanoServerImage PowerShell Module for Technical # Preview 4 Import-Module ` -Global C:\NanoServer\NanoServerImageGenerator.psm1 ;
# Create New Basic NanoServer Image with IIS for Technical # Preview 4 with IIS Package New-NanoServerImage ` -MediaPath "Z:" ` -BasePath "C:\NanoServer\Base" ` -TargetPath "C:\NanoServer\WS16TP4NSIIS1\WS16TP4NSIIS1.vhd" ` -EnableRemoteManagementPort ` -Language "en-us" ` -GuestDrivers ` -DriversPath "C:\NanoServer\VMware-Drivers" ` -Packages "Microsoft-NanoServer-IIS-Package" ` -Ipv4Address "192.168.100.25" ` -Ipv4SubnetMask "255.255.255.0" ` -Ipv4Gateway "192.168.100.3" ` -DomainBlobPath "C:\NanoServer\WS16TP4NSIIS1.djoin" ` -AdministratorPassword (ConvertTo-SecureString ` -String "Password" ` -AsPlainText ` -Force) ;
Verify and obtain the Nano Server IP Address from the Nano Server Recovery Console
Verify the website is loading from another machine;
- Launch a Web Browser
- Input the IP Address of the Nano Server
- Verify that the IIS Default Website is loading
Manage Nano Server remotely using PowerShell Session
In this example, we will connect to Nano Server remotely using Enter-PSSession PowerShell Cmdlet to manage the Nano Server remotely and configure the Primary DNS Server Address and DNS Search Suffix List.
# Verify if the Nano Server is a Trusted Hosts Get-Item ` -Path WSMan:\localhost\Client\TrustedHosts ;
# Set the Nano Server IP Address to be a Trusted Hosts Set-Item ` -Path WSMan:\localhost\Client\TrustedHosts ` -Value "192.168.100.24" ` -Force ;
# Establish a remote PowerShell Session to the Nano Server Enter-PSSession ` -ComputerName 192.168.100.24 ` -Credential (New-Object ` -TypeName System.Management.Automation.PSCredential ` -ArgumentList "192.168.100.24\Administrator", ` (ConvertTo-SecureString ` -String "Password" ` -AsPlainText ` -Force) ` ) ;
Configure the Network Interface DNS Server configuration
In this example, it demonstrate on how to configure the Network Interface DNS Server Address and Search Suffix List. Unfortunately, we cannot use Resolve-DNSName PowerShell Cmdlet and therefore utilise the NSLookup instead.
# Get the network interface information on the Nano Server Get-NetIPConfiguration ;
# Set the primary DNS server address on network interface # on Nano Server Set-DnsClientServerAddress ` -InterfaceIndex 3 ` -ServerAddresses ("192.168.100.11") ;
# Set the DNS search suffix list on Nano Server Set-DnsClientGlobalSetting ` -SuffixSearchList @("naboo.co.nz", "tatooine.co.nz") ;
# Verify Domain Name resolution is working using Nslookup # instead of using Resolve-DNSName PowerShell Cmdlet # because it is not available on Technical Preview 4 nslookup naboo.co.nz
Once the Primary DNS Server Address and Search Suffix List has configured, you will need to ensure that the DNS Server has an A Record of the Nano Server Hostname. With the A Record of the Nano Server in the DNS Server, you will be able to verify the Default Website with the Hostname on Port 80.
Verify the website is loading from another machine;
- Launch a Web Browser
- Input the Hostname of the Nano Server
- Verify that the IIS Default Website is loading
Getting Started with a new Web Site on Nano Server
In this example, we will demonstrate how to create another Web Site on IIS in Nano Server using the new IISAdministration PowerShell module with a custom web binding.
# Import IIS Administration PowerShell Module Import-Module IISAdministration ;
# Create a folder New-Item ` -Path "C:\IIS-Site" ` -Type directory ;
# Create a default page without ConvertTo-Html PowerShell # Cmdlet because it is not available on Technical Preview 4 "Welcome to IIS on Nano Server by Ryen Tang (MVP)" | Out-File ` -PSPath "C:\IIS-Site\Default.htm" ;
# Create a new IIS Website New-IISSite ` -Name "IIS-on-NanoServer" ` -BindingInformation "*:80:iis.nanoserver.naboo.co.nz" ` -PhysicalPath "C:\IIS-Site" ;
# Verify the new IIS Site is created (Get-IISServerManager).Sites ;
Verify the website is loading from another machine;
- Launch a Web Browser
- Input the URL
- Verify that the new IIS Website is loading