Fundamentals of IIS

This document gives a fundamental overview of how IIS (Internet Information Server) works and we will be looking at it from the perspective of the system administrator, rather than the web developer. Most of the information and examples here have been researched with IIS versions 7.0 and 7.5 running on Windows Server 2008 and R2.

IIS is one of those things that many system administrators look after as part of their administrative work when dealing with servers and networks in general. For some companies and establishments, it is a vital part of their operations, yet there are no specific Microsoft certification examinations for IIS (not since IIS version 4.0 that was used with Windows Server NT 4), although there is plenty of training and several publications are available.

This overall introduction gives a good understanding of the basics of IIS and it is assumed that the reader is already quite familiar with Microsoft technologies in general, including the installation and configuration of servers and desktop computers, but may have had little or no exposure to web services.

The purpose of IIS
Chances are that you are reading this document on your monitor using a web browser. That web browser is connected to a computer server somewhere over the Internet and that server is actually a web server whose function is to serve information like this in web pages to clients such as yourself. That is the web server role in its most basic function – distributing web pages.

A user requests a web page through their workstation browser and the web server receives that request, processes the request by finding the data on the server disk drive and sending out the requested page(s) of information. This can be sent over the Internet to anywhere in the world, or it could be restricted to a company environment, where it is referred to as an intranet instead.

Static and dynamic web content
In past times, web servers were just set up to produce static web pages. Somebody would compile a page of information and it was distributed throughout the Internet as required. The content of the pages either stayed the same or somebody would occasionally edit the source page and redistribute it – very much like reading a book. A book contains the same content but sometimes the later editions of the book may have minor changes made.
Now consider reading about content that changes much faster. You may access a web site that is linked to one of the big news agencies, or it could be a weather station site. Content changes much faster here and now instead of only using static web pages our content must contain a dynamic element. This dynamic component is produced by an application server and this connects with the web server to still produce web pages, but with content that updates at a fast rate.

An application server connects to the web server and intercepts requests for dynamic data. The application server can also connect to databases for large volumes of dynamic content. Application servers can also provide some intelligent processing for us.

Microsoft versions and compatibility
It should be noted that IIS versions are integrated tightly into the Windows operating system they are used with. A specific version of an operating system is only compatible with a specific version of IIS. When the two are designed together, it provides for faster and more efficient page serving. The only way to (easily) change the version of IIS is by using the compatible version of the OS. You also cannot have multiple versions of IIS running on the same server. If you have a specific application that requires the use of an earlier IIS version, it is preferable to try and configure the application settings rather than to make changes to IIS.

The following table shows which main versions of IIS are integrated with which Microsoft Windows servers. IIS is usually to be found on Windows Servers, but can also run on client systems where it is useful for very small distributions or for testing purposes.

Windows OS version                      IIS version
Windows NT 3.51 SP3                    IIS 1.0
Windows NT 4                                 IIS 2.0
Windows NT 4 SP2                         IIS 3.0 and 4.0
Windows 2000                                 IIS 5.0
Windows XP Professional               IIS 5.1
Windows 2003, XP 64-bit                IIS 6.0
Windows 2008, Vista                       IIS 7.0
Windows 2008R2, 7                        IIS 7.5
Windows 2012, 8                             IIS 8.0

To find out which version you are running, it is easy just to look at the table above. If you want to double-check the IIS version (maybe somebody has been playing around with your IIS files and versions) then try one of these methods:

  • In IIS Manager, use Help > About
  • Open a browser and enter this in the address field:   http://localhost
  • Look at the details in the file properties of:  ~\system32\inetsrv\InetMgr.exe
  • Check the registry entry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\VersionString

Installation of an IIS server
The information up until now has been a basic overview. From this point onwards it gets more technical and deals with the core of administering IIS.

From version 7 onwards, IIS is now modular. This means that you only install the components within IIS that you are going to be using. It makes for a more efficient and secure system.

The installation within Windows 2008 and 2012 is very straightforward and is done via a role in Server Manager or PowerShell. For our examples, we will assume the easier method using the GUI.
The name of the role to install is Web Server IIS. When you opt to install it, you are presented with several possible role services to include in your installation. These are just the components that can be included as part of the IIS installation. You will notice that only a few are selected and these are the bare minimum that will be required to set up IIS and to be able to serve basic static web pages. It is a good starting point and you can add more complexity later.

Saying that, there may be some choices that you want to select now, during the initial install, as they may be useful.
If users accessing pages may need to be redirected to another location because the pages may have moved or changed name, then select the HTTP Redirection option. This will prevent your users getting the Page not found (404) error.
Also, in the Application Development section, this is where you can specify what type of dynamic content you want to serve. If it will be purely static content then there is no need to select anything here.
During the initial stages of usage, consider selecting the options under the Health and Diagnostics section to be able to access more detailed logging.

In IIS 7, if you are going to choose to add the FTP option, then you will also need to include the IIS 6 Metabase Compatibility component. Ensure that it is selected after you opt for the FTP component install.

If you want to install IIS on a client workstation, such as Vista or later, then in Control Panel go to Programs and Turn Windows features on or off and select in a similar way as outlined above for the server.

You can test for a good installation by opening a web browser and accessing:   http://localhost  and you should see the logo of the IIS server and its version number.

Under the Administrative Tools menu, open the IIS Manager and drill down under the server name in the left pane to Sites and you will see the Default Web Site that has been installed as your default starting point.

Home directories and virtual directories
There are two types of directory in IIS. A Home directory is a direct link to where data is stored. For example, the default web site that is created when IIS is installed is actually located in C:\inetpub\wwwroot\ and inside that folder you will see the start file of iisstart.htm and the accompanying graphic file welcome.png. These two files together are what produce that IIS logo we saw earlier when testing the installation.

We can also create a sub-directory under the Default Web Site directory in IIS Manager and add some files there. We access that using its name as:  http://[server]/[subdir]

If we try to access a page that does not exist, we will get a HTTP Error 404.0 – Not Found page.
If we don’t have permission to access a directory, we get a HTTP Error 403.14 – Forbidden page.
These error pages are located in C:\inetpub\custerr\en-US\ and they could be substituted with custom pages.

Another way of setting up a web site is to create a virtual directory. A virtual directory physical content folder can be located anywhere, even a shared folder on another server, but still appear to be a part of the web site.
To create a virtual directory, just right-click the Default Web Site node and select Add Virtual Directory. Now specify an alias (the name you will access the site with) and its corresponding physical path to where the data is actually stored.

To set up a new site outside of the Default Web Site, right-click the Sites node and Add web site.

When you select a web site node in the left pane of IIS Manager, the icons in the central pane are where most of the configuration and option settings will occur.

I hope at least that this has given a basic grounding in the elements of IIS. There is a lot to IIS but it’s not so difficult to learn.