Introducing IIS on Nano Server

(10/12/2016 - Refreshing blog content and steps now that WS 2016 is GA!)

Nano Server

Nano Server is an exciting new installation option in Windows Server 2016.

Here’s a quote from the Get Started with Nano Server Guide that summarizes Nano Server pretty well :

“Nano Server is a remotely administered server operating system optimized for private clouds and datacenters. It is similar to Windows Server in Server Core mode, but significantly smaller, has no local logon capability, and only supports 64-bit applications, tools, and agents. It takes up far less disk space, sets up significantly faster, and requires far fewer updates and restarts than Windows Server. When it does restart, it restarts much faster.”

So Nano is much smaller on disk. Faster. Less reboots. Uses less memory. What’s not to like? :)

Here are some good blogs from the Windows Server team that talk about Nano Server.

IIS on Nano Server

With General Availability of Windows Server 2016, I’m pleased to announce that IIS is now available as a role in Nano Server, for everyone to try out. With smaller memory and dramatically smaller disk footprint, web workloads are particularly suited to running on Nano Server, especially for high density hosting.

Getting started

But essentially, the most common way of creating a Nano Server vhd(x) is via the New-NanoServerImage cmdlet.

To enable IIS, we just pass in Microsoft-NanoServer-IIS-Package as an argument to the Package parameter. e.g.

New-NanoServerImage -Edition Standard -DeploymentType Guest -MediaPath f:\ -BasePath .\Base -TargetPath .\Nano1.vhd -ComputerName Nano1 -Package Microsoft-NanoServer-IIS-Package

Key Differences between IIS on Nano and Regular Server

Installation

We have made a lot of changes in IIS for Nano to support both online and offline install. By ‘online’ we mean when the machine is ‘running’ (we don’t mean online in the network connectivity sense) and by ‘offline’ we mean when the machine is not running.

Historically and on regular Server, IIS can only be installed online (machine running). When preparing a machine with IIS you would typically follow a sequence such as:

  1. Install OS
  2. Wait for install to complete
  3. Enable IIS Role
  4. Wait for IIS role to complete
  5. Configure settings – e.g. authentication settings, modules, Asp.Net

With Nano Server, setup can be provisioned offline, therefore dramatically simplifying and speeding up steps 1 thru 4 above.

When using New-NanoServerImage to create a vhd(x) with Microsoft-NanoServer-IIS-Package we configure a default working install of IIS

  • IIS Services installed (e.g. WAS, W3SVC)
  • A default set of IIS sub-features enabled, such as Default Document, Static content, HTTP logging etc.
    • Refer to chart for which sub-features are enabled by default.
  • Firewall rule enabled for default 80/443 ports

It becomes extremely fast to provision new web server machines when using the generated vhd(x) image that has IIS already baked-in. On my office desktop machine, I was able to create new VMs, do offline specialization, boot up and be serving web requests all in about 25 seconds. Trying to do the same with Server Core would’ve taken many times that.

Configuration

As of WS 2016 GA version, configuring IIS sub-features such as authentication and logging is similar as for regular server.

e.g. dism /online /enable-feature /all /featurename:IIS-WindowsAuthentication

To list enabled features: dism /online /get-features

In Preview versions of WS 2016 it was required to manually configure sub-features through editing applicationHost.config, but this is no longer required with the GA version.

Supported Frameworks

Asp.Net Core:
The most notable difference between Nano and regular Server is that Nano targets Asp.Net Core (formerly known as Asp.Net 5). Classic Asp will not run on Nano and neither will full .Net Framework applications such as Asp.Net <=4.

Here's my blog posting on how to get an Asp.Net Core application running with IIS on Nano.

Java:
Java applications can be hosted on IIS via HttpPlatformHandler.

My co-worker Jeong Hwan has a blog post here on how to get Java working with IIS on Nano

PHP:
PHP on IIS runs the same on Nano the same as on regular server (e.g. through FastCgi).

Here's a blog post from Jeong Hwan on how to get a PHP (WordPress) application running on Nano with WinCache and IIS.

Others:
Supporting Asp.Net Core, Java and PHP on IIS Nano is a great start though we do have plans to get additional platforms supported. The HttpPlatformHandler is a general purpose module for managing and sending requests to http listeners, so there could well be more platforms that can run well on Nano that we haven’t tested and so haven’t listed.

If you do try this (e.g. with Ruby or Node) and get it working let us know!

Management

Nano Server is a ‘headless’ OS – there is no GUI on the server itself. PowerShell is front and center of the Nano management experience. Of course this means you will be able to manage IIS on Nano using our IIS PowerShell cmdlets.

I should clarify that as of IIS 10.0 there are 2 IIS PowerShell modules:

Nano Server is a clean server platform for the future and so we currently have no plans to include the older legacy WebAdministration module at this time. Instead we will provide the new IISAdministration module.

In addition to PowerShell (IISAdministration), using appcmd.exe to manage IIS is also an option.

For GUI client, Inetmgr is not available for Nano. Running Inetmgr on a regular non-Nano WS2016 server connecting to Nano IIS will not work.

Microsoft IIS Administration:

There is an exciting new IIS Management project (Microsoft IIS Administration) from the IIS team that does provide multiple additional options for you to manage Nano IIS, including a Web UI!.

You can read more about this in the following blogs:

https://blogs.iis.net/adminapi/microsoft-iis-administration-on-nano-server

https://blogs.iis.net/adminapi/microsoft-iis-administration-api-preview

You can get started here: https://manage.iis.net

 

10 Comments

  • Is it planned to support .NET 4.x on Nano server by its release time or will it always be ASP.Net Core only?

  • Full .Net framework support is not currently planned as it brings in many additional dependencies which runs counter to the 'lean and mean'/small footprint purpose of Nano. There is a uservoice on this where you can vote and give feedback to the Nano team: http://windowsserver.uservoice.com/forums/295068-nano-server/suggestions/8106009-enable-full-net-framework-on-nano

  • Which version of php can you run on nanoserver? PHP7 needs visual studio runtime 2015. nano server seems to have only version visual studio runtime 2013.

  • Nano is 64bit only so only PHP7 (as that's the one with full 64bit support). You are right about the runtime. Right now you would have to copy over vcruntime140.dll over to %windir%\system32 on the Nano machine. Not sure if that will change in later versions of Nano. We'll have a blog on the PHP/Nano steps very soon.

  • Do you know if there is any other requirements to php7 than vcruntime140.dll?
    I've tried copying it over from a 2016 server with visual studio 2015 x64 installed, to the nanoserver, but I still get that 500-error with "FastCGI process exited" and error code 0xc0000135.
    From what I have found, a lot of people have resolved that error code by installing the corresponding version of Visual Studio Runtime, on servers with gui.

    Really waiting for a PHP/Nano blog :) Can't really find anyone that have mentioned PHP/Nano anywhere.

  • Here's the PHP/Nano blog posting: https://blogs.iis.net/jeonghwan/running-wordpress-with-iis-and-wincache-on-nano-server

  • Will IIS Administration MMC snap in from remote computer work?

  • IIS Admin MMC from remote machine will not work. This depends on the IIS management service (wmsvc) which won't exist on Nano as part of the major refactoring work. However we will have an equivalent (IIS REST Admin service) that we will be announcing very soon with preview bits for people to try out, hopefully in a few weeks time. The new admin service will expose a web based UI (as opposed to MMC snapin)

  • What is the licencing for the nano server? is nano free or lower cost?

  • hi guys, I'm going to setup a web server using nano server and put iis and sql server in it. I'm ok with iis but how can I have sql server on nano server?? nano server aims to support services and sql is a service and could be managed remotely, am I wrong?

Comments have been disabled for this content.