Home Cloud & Networking Microsoft IIS 10.0 Cookbook

Microsoft IIS 10.0 Cookbook

By Ashraf Khan
books-svg-icon Book
eBook $43.99 $29.99
Print $54.99
Subscription $15.99 $10 p/m for three months
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
eBook $43.99 $29.99
Print $54.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    Integrating IIS 10.0 with Windows Server 2016
About this book
This book will start with customizing your IIS 10 to various platforms/OS and tune it according to your business requirements. Moving on, we will focus on the functionalities of core fundamentals and perform practical scenarios in order to maximize the use of a reliable web server. Going further we will be covering topics like IIS 10 architecture, IIS modules,hosting web server platforms, virtual directories along with web site deployment, ports, enhanced security. We will also cover new features of IIS 10 like integration with Windows Server 2016 and Nano Server, HTTP/2, PowerShell 5 cmdlets etc . Towards the end, we will cover troubleshooting & diagnostic techniques of IIS 10. By the end of this book you will be well versed with maximizing the reliability of your webserver and will have immense knowledge in using IIS 10 effectively
Publication date:
June 2017
Publisher
Packt
Pages
410
ISBN
9781787126671

 

Integrating IIS 10.0 with Windows Server 2016

In this chapter, we will cover the following recipes:

  • IIS 10.0 architecture
  • Installing IIS 10.0 on Windows Server 2016
  • IIS Manager
  • Basic configuration of IIS 10.0
  • Hosting a static page
  • Testing a static-page website
 

Introduction

IIS 10.0 is the latest version of Internet Information Services (IIS), which is an extensible web server developed by Microsoft. IIS 10.0 was introduced with Windows Server 2016 and Windows 10. The new features of IIS 10.0 are HTTP/2, IIS on Nano Server, Wildcard Host Headers, and PowerShell 5 cmdlets, and so on. In addition, it supports all the previously supported features: HTTP, HTTPS, SMTP, SNMP, FTP, and FTPS.

The recipes in this chapter will primarily focus on the integration of IIS 10.0 with Windows Server 2016.

We will start with some basic information about IIS 10.0. After that, we will integrate IIS 10.0 with Windows Server 2016 and configure and test our first sample web page.

Understanding IIS 10.0

In this recipe, we will understand how to work with IIS 10.0's new features. We will have an overview of the following new features added to IIS 10.0:

  • HTTP/2

HTTP/2 requests are now faster than ever. This feature is active by default with IIS 10.0 on Windows Server 2016 and Windows 10.

  • IIS 10.0 on Nano Server

IIS 10.0 is easy and quick to install on Nano Server. You can manage IIS 10.0 remotely with PowerShell or the IIS Manager console. Nano Server is much faster, and consumes less memory and disk space that the full-fledged Windows Server. Rebooting is also faster so that you can manage time effectively.

  • Wildcard Host Headers

IIS 10.0 support the subdomain feature for your parent domain name. This will really help you manage more subdomains with the same primary domain name.

  • PowerShell 5 cmdlets

IIS 10.0 adds a new, simplified PowerShell module for quick and easy management. You can use PowerShell to access server-management features remotely. It also supports existing WebAdministration cmdlets.

  • FTP

FTP is a simple protocol for transferring files. This system can transfer files inside your company LAN and WAN using the default port, 21. IIS 10.0 includes an FTP server that is easy to configure and manage.

  • FTPS

FTPS is the same as FTP, with the only difference that it is secure. FTPS transfers data with SSL. We are going to use HTTPS port 443. For this, we need to create and install an SSL certificate that encrypts and decrypts data securely. SSL ensures that all data passed between web server and browser remains private and consistent during upload and download over private or public networks.

  • Multi-web hosting

IIS 10.0 allows you to create multiple websites and multiple applications on the same server. You can easily manage and create a new virtual directory located in the default location or a custom location.

  • Virtual directories

IIS 10.0 makes it easy to manage and create the virtual directories you require.

Basic requirements of IIS 10.0

Before we run our web server either in operations or staging mode, we have to plan it. What type of website and application are we going to publish? For example, our website needs a server that supports .NET framework 4.5 on IIS 10.0. We need to know the supported operating system and hardware requirements.

Let's take a look at the requirements in detail.

OS requirements

The following subsections detail the estimated system requirements for Windows Server 2016. If your computer has less than the minimum requirements, you will not be able to install this product correctly. Actual requirements will vary based on your system configuration and the applications and features you install. Unless otherwise specified, these minimum system requirements apply to all installation options (Windows 2016 Server Core, Windows Server 2016, Nano Server, and Windows 10) and both the Standard and DataCenter editions. IIS 10.0 Express supports Windows 7 Service Pack 1, Windows 8.1, Windows 8, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows 10, and Windows Server 2016.

For the best results, conduct test deployments to determine the appropriate system requirements for your particular deployment scenario.

Hardware requirements

Let's look at the minimum hardware requirements to run Windows Server 2016 and Windows 10:

Windows Server 2016

  • Processor: 1.4 GHz 64 bit
  • RAM: 2 GB for 64-bit OSes
  • Hard disk space: 32 GB

Windows 10

  • Processor/SoC: 1 GHz
  • RAM: 1 GB for 32-bit or 2 GB for 64-bit OSes
  • Hard disk space: 16 GB for 32-bit or 20 GB for 64-bit OSes
  • Graphics card: DirectX 9 with the WDDM 1.0 driver

Operating system media

IIS 10.0 installation requires operating system media. While installing IIS 10.0 on Windows Server 2016, sometimes, it asks for the operating system media for required files. We have to insert the media either in CD or USB drive form.

To install IIS 10.0 Express only, we need the IIS 10.0 Express software, which is available on the Microsoft IIS website (https://www.microsoft.com/en-us/download/details.aspx?id=48264). You only need the software and an Internet connection.

 

IIS 10.0 architecture

We need to understand what resources are available to your IIS application; how it handles content files of different types, such as static files, ASP files, or ISAPI files; and how it groups content files into applications. An introduction to the client/server relationship is included for first-time readers unfamiliar with web servers.

IIS 7 and later provide a request-processing architecture. We get the following additional benefits of request processing, since the default configuration monitors each request and validates implemented security rules:

  • The Windows Process Activation Service (WAS), which enables sites to use protocols other than HTTP and HTTPS
  • A web server engine that can be customized by adding or removing modules
  • Integrated request-processing pipelines from IIS and ASP.NET

Getting ready

We require an up-and-running IIS 10.0 instance. Security components should be installed. You should have administrative privileges.

How to do it...

Now, we are going to review the components and modules.

  1. Start Server Manager on Windows Server 2016, which already should have IIS 10.0 installed on it.
  2. Go to the Tools menu at the top.
  3. You will be able to see Internet Information Service Manager (IIS).

  1. Click on IIS Server, which is to the left-hand side of the IIS Manager window, as shown here:
  1. In the Server Manager panel, you will see the list of default components installed. You can configure them as per your requirements. For example, you can configure security and management options.
  2. Let's understand where the modules are. In the previous figure, you will see the icon called Modules, which will open the default configuration at this stage.

  1. Double-click on Modules, and you will get the list of modules available in IIS 10.0:
  1. All the modules are by default configured to native mode. We can reconfigure them as per our application requirements.

How it works...

The combination of components and modules helps us implement application request processes and security settings quickly.

Introducing the IIS 10.0 architecture's components and modules

Let's discuss the components and modules available in IIS 10.0 Server in detail.

Overview of an HTTP request

Let's observe HTTP requests of IIS 10.0 IIS 7 and later versions have an HTTP request-processing flow similar to that of IIS 6.0 and below.

  1. When a client browser initiates an HTTP request for a resource on the web server, HTTP.sys intercepts the request.
  2. HTTP.sys contacts Windows Activation Service (WAS) to obtain information from the configuration store.
  3. WAS requests configuration information from the configuration store, applicationHost.config.
  4. The World Wide Web Publishing Service (WWW Service) receives configuration information, such as application pool and site configuration.
  5. The WWW Service uses the configuration information to configure HTTP.sys.
  6. WAS starts a worker process for the application pool to which the request was made.
  7. The Worker Process processes the request and returns a response to HTTP.sys.
  8. The client receives a response.
https://media-www-iis.azureedge.net/media/7188132/introduction-to-iis-architecture-101-overviewofhttprequest.png

Details of an HTTP request inside the worker process

In a worker process, an HTTP request passes through several ordered steps, called events, in the Web Server Core. At each event, a native module processes part of the request, such as authenticating the user or adding information to the event log. If a request requires a managed module, the native Managed Engine module creates an AppDomain, where the managed module can perform the necessary processing, such as authenticating a user with Forms Authentication. When the request passes through all of the events in the Web Server Core, the response is returned to HTTP.sys. The following figure shows an HTTP request entering the Worker Process:

https://media-www-iis.azureedge.net/media/7188126/introduction-to-iis-architecture-101-httprequestworkerproc.png
 

Installing IIS 10.0 on Windows Server 2016

From the previous recipes, we've understood the basics of IIS 10.0. Now we will go install IIS 10.0 on Windows Server 2016. We are already aware of the requirements. We will use GUI-mode installation, which will show you how to install and which options you need to select.

Getting ready

To step through this recipe, you will need a running Windows Server 2016 instance and installation media. You should have administrative privileges.

How to do it…

  1. Log in to Windows Server 2016 with an account with administrative privileges.
  2. Open Server Manager from the Start menu or use the search window to find it.
  1. You have to click on Add roles and features, or you can find the same option in top Manage menu.
  1. On the Before you begin wizard, simply click on the Next button. This window is just for information about installation prerequisites.
  2. On the Select installation type wizard, leave the default option Role-based or feature-based installation selected and click on Next.

  1. Now we have to select which server we have to install IIS 10.0 on. We are installing to our local machine, so leave Select a server from the server pool with the current machine selected and click on Next. Alternatively, you can select another server that you are managing from here. You can figure it out in the following diagram:
  1. Now we have to select the role from the Select server roles wizard. Check the box next to Web Server (IIS). Doing this may open up a new pop-up window advising that additional features are required; simply click on the Add Features button to install them as well. Click on Next on the Select server roles menu once this is complete.
  1. Once we have selected Web Server (IIS), we will get a list of additional features, which we can select from. At this stage, we are not going to select any features, so simply click on Next in the Select features wizard.
  2. Click Next on the Web Server Role (IIS) wizard after reading the information provided.

  1. The next window in the Select role services wizard allows you to install additional services for IIS, if required. You can always come back and add more later, so just click on Next for now to install the defaults.
  1. Now we are on the Confirm installation selections wizard, so review the items that are to be installed and click on Install to proceed with installing the IIS 10.0 web server on Windows Server 2016.
  1. Here, you can see the restart checkbox. No need to mark it for a normal IIS 10.0 installation--only when you uninstall something from the server or install an additional component that requires restarting the server do you need to reboot the system.

  1. Once the installation has succeeded, you can click on the close button. IIS 10.0 by default runs on port 80. It will auto-enable the World Wide Web Services (HTTP Traffic-In) firewall rule in Windows Firewall.

How it works...

When your are running your web server, it will process the request through the default http port, which has a numeric value of 80. The firewall rule was already enabled in the installation process. Now we need to know whether it's working fine.

We will perform a simple test by opening a web browser such as Internet Explorer and type the server IP address, http://127.0.0.1/, or http://localhost/ in the browser address bar and hit Enter to run the application. You will see the default IIS welcome page.

Look at this screenshot, which shows IIS 10.0 running on Server 2016.

 

IIS Manager

Now that we know how to install IIS 10.0, let's take a look at IIS Manager, which comes as a part of the IIS 10.0 Management tools provided by Microsoft. IIS 10.0 can be managed in either GUI mode or with PowerShell commands. The IIS Manager GUI interface comes with Windows Server 2016 by default.

We will also learn how we can connect a remote IIS server with IIS Manager.

Getting ready

To step through this recipe, you will need a running IIS 10.0 instance on Windows Server 2016. For remote IIS management, you need to Install IIS management tools.

How to do it...

  1. Start Server Manager on Windows Server 2016, which already has IIS 10.0 Installed on it.
  2. Click on the Tools menu.
  3. At the top, you will be able to see Internet Information Service Manager (IIS). This figure will show you how to get there:
  1. You will now see the IIS Manager home screen.
  1. IIS Manager shows you its connected servers, which have IIS 10.0 already installed on it.
  2. Then, we select WIN2016IIS (WIN2016IISAdministrator), which is at the left-hand side.
  3. The IIS Manager home screen will display the default features of IIS 10.0.

  1. As you can see in the following figure, there is an Application pool on the left-hand side along with your Default Web Site. Then, there are feature configuration options available in the middle section and then Manage Server, Restart, Start, and Stop at the right. You can browse the website from here.

How to manage remote IIS?

  1. You have more than one IIS Server instance available to manage even only
    website or web application want to manage from IIS Manager.
  2. We are going to connect a remote IIS Server instance with IIS Manager on Windows Server 2016. This you can do with any operating system that supports IIS 10.0.

  1. First, you have to install the Management Service role on the remote IIS server.
  2. Follow these path indicated by the next screenshot. You only have to select the Management Service feature.
  1. Select Management Service, press Next, and Finish the installation.

  1. Now open IIS Manager on remote server 172.16.15.212--this is the IP address in my case, but in your case, it will be your local machine's IP address. The default local machine IP address is 127.0.0.1. We have to enable remote connections, so select the IP of the server and set the Default port to 80. Allow access, Apply, and then Start. You can refer to this screenshot:
  1. Now we have to come to Windows Server 2016, which has IIS 10.0 Installed.

  1. Right-click on the Start Page icon or click on the globe below Connections. You will see the option to connect to an IIS Server, a website, or application.
  1. We will work on the server connection option first. Click on Connect to Server, which is listed in the previous screenshot. On the next screen, it will ask you whether you want to select a remote server IP or Computer Name.

  1. Enter the server IP address, which is 172.16.15.212. You will see the next screen. Click on the Next button to finish the current step.
  1. Now you have to enter your username and password, after which a server certificate confirmation alert pop-up message comes up on a successfully authenticated username and password. Click on the Connect button.
  1. Then, provide the server name. We are using remote IIS as the server name. Click on Finish. That's it; you're done. In the next screenshot, you can see the remote IIS server connected in the left-hand panel of connections for remote IIS management.

How it works...

Remote management for IIS Server is an easy way to manage several IIS servers at the same time from a single window. You can manage websites and application pools remotely as well.

 

Basic configuration of IIS 10.0

In this recipe, we will learn about the basic configuration of IIS 10.0. We are going to review the Inetpub folder, wwwroot folder, and logs folder.

We will also be covering binding options and limits.

Getting ready

We require an up-and-running IIS 10.0 instance. You should have administrative privileges for IIS management.

How to do it...

  1. When we installed IIS 10.0 on Server 2016, the default installation folder location was C:\inetpub.
  2. Log in to Windows Server 2016, go to the C:\ drive, and find the default IIS folder called inetpub. You can see this in the following figure:
  1. By default, all the website files will be stored in the wwwroot folder. The path is C:\inetput\wwwroot. The following screenshot shows the default IIS 10.0 website files:
  1. Now, we are going to see the logs folder. It is located at C:\inetpub\logs:
  1. Start IIS Manager and select the Default Web Site. You will get the Actions window on the right-hand side. Inside the Actions list, we have the Edit Site option.
  1. Click on the Basic Setting... text button. You will get the following window for basic settings:
  1. We selected the Default Web Site; now you can see the Site name, Application pool, Physical path, and Connect as... authentication option.
  2. In the Edit Site window, you can change the Application pool and define your website folder path or default type of authentication. Finally, you can test the default settings.
  3. Let's look at some binding options. In the Actions list, you will see that there is a Bindings... option. Bindings are used for defining your website parameters: Type http, Host Name www.xyz.com, Port 80, and IP Address * for example, as shown here:
  1. Now, set the Limits for website access. In the Actions list, which is available on the right-hand side of IIS Manager, go to the Default Web Site properties.

  1. On the configuration screen, click on Limits.... You will get the following pop-up window:
  1. Here, we can limit the bandwidth usage in bytes, limit the connection timeout in seconds, and also limit the number of connections.

How it works...

We have installed IIS 10.0 with the default options and IIS 10.0 default website configuration. We also had an overview of wwwroot, logs, and the configuration window. This will help us find out where the wwwroot and logs folders are located. We also reviewed the basic and default configuration of websites, binding options, and limits.

In the next recipe, we will create and configure our own settings.

 

Hosting static web page

In this recipe, we will host our simple HTML web page.

Getting ready

We need to create an HTML web page and have IIS 10.0 running. You will also require user administrator rights for hosting the site.

How to do it...

  1. Open Notepad and type something, like the text shown in the following screenshot. You can write anything you want.
  2. Save the Notepad file on your desktop with the name of index.html.
  1. Next, you have to open IIS Manager, select the Default Web Site, and right-click on it:
  1. Click on the Explore option from the pop-up menu.
  2. It will open the Inetpub folder from the C:\inetpub\wwwroot default website folder location, where you will have kept your web application or website files. The wwwroot folder is your hosting directory.

  1. Copy index.html from the desktop and paste it in the C:\inetpub\wwwroot folder, as shown here:
  1. Select the Default Web Site, which is listed on the left-hand side of IIS Manager. You will get the Default Document module.
  2. Now you have to open the Default Document. There is already a list of filenames and extensions available. These names exist by default. If you want your custom filenames and extension to get listed there, you can add them to the Default Document and make sure you move the custom extension to the top of the default document settings.

  1. Click on Default Web Site. You will see the property page come up:
  1. Open the Default Document. You will find Default.htm, Default.asp, Index.html, and many names listed. Our filename is Index.html, and the default document already has the same name.

How it works...

Once we check the Default Document configuration and find the index.html name already listed, we have to open the web page, and the default home page will open. The Default Document setting is very helpful for launching your website as you will select it and you need to tell IIS Server what your home page is.

 

Testing a static-page website

We've already uploaded the static index.html page to the wwwroot folder, and we've checked the Default Document settings for the default home page. Now let's see how to test the static web page.

Getting ready

We have to test whether the web page is working. You need an up-and-running IIS 10.0 server instance and a static HTML web page.

We have already created the index.html page and uploaded it in the IIS wwwroot directory.

How to do it...

  1. Open Internet Explorer.
  2. You have to provide the URL of your web page in the address bar. We have IIS 10.0 installed on the localhost (local server).
  3. Type the URL http://localhost/ and press Enter . Your page will look like this:

How it works...

Once you access your web page through IIS, the page is displayed through HTTP port 80. You can try uploading more pages.

About the Author
  • Ashraf Khan

    Ashraf Khan works as the Head Of Network Operating System Unit, with a diverse background in production systems, Network Administration, and Solutions Architecture. He has the MCSE-Server, MCSE-Messaging, MCSE-Cloud, CCNA, ITIL & Prince2 certifications. He has more than 13 years of experience in sectors such as IT infrastructure and private and government sectors located in India and the UAE and remote support for USA and worldwide for physical and virtual server environment IT management, implementation, planning, disaster recovery, testing, and technical support.

    Browse publications by this author
Latest Reviews (4 reviews total)
see previous comment
very useful especially with Web App first steps..
Great Product at a Great Price
Microsoft IIS 10.0 Cookbook
Unlock this book and the full library FREE for 7 days
Start now