After you have installed IIS, you will have access to
the default tool to manage the web server. This tool is the IIS
Management Console. However, you may need to install additional
components depending on the management needs for your Windows Server
2008 R2 web server or web server farm. The IIS Management Console will
also provide you with the ability to manage IIS 7.0 from Windows Server
2008.
IIS also provides the
ability for you to manage and support your previous IIS 6 installations.
If you need to have these capabilities, simply select them during the
IIS server installation. This section will focus on managing IIS 7.5,
which is built into Windows Server 2008 R2.
1. Work with the IIS Management Console
You can access the IIS
Management Console in one of two ways. You can access the tool via
Server Manager under Roles, or you can access the console via the
administrative tools. Depending on the screen resolution of the
workstation you are managing the server on, you may consider using the
selection in the Administrative Tools group. The IIS Management Console
can take up a lot of screen real estate. To load the IIS Management
Console from the Administrative Tools group, simply select Internet
Information Services (IIS) Manager. To access the console, click Start => Administrative Tools => Internet Information Services (IIS) Manager. When you load the console, you will see a screen similar to Figure 1.
The start page gives you some
basic tasks, allowing you to connect to other websites and applications.
You will also be able to access online websites and help files. One
resource specific for IIS you will want to make note of is www.iis.net, which is great website with tons of references and examples for you to use when maintaining your web server.
In prior versions of IIS, configuration was stored in a location called the metabase.
You may have used this very unwieldy file. Now in IIS, the
configuration is XML-based and is centralized on the server. Three main
files make up the IIS manager configuration. The files, by default, are
located in your Windows directory in the System32\Inetsrv\Config folder:
administration.config: This configuration file contains all the management settings for your IIS server and your management console. applicationhost.config: This stores all the settings for the websites located on your web server. redirection.config:
This file allows you to have centralized settings. You can use this
file to redirect the IIS server's configuration to a centralized server
location.
These files create the main
default settings for your web server. A good reference for you to learn
more about the configuration files is at http://learn.iis.net/page.aspx/122/getting-started-with-iis-7-configuration/.
|
The true power in the IIS
Management Console is when you first click a server in your management
console; you will see a screen similar to Figure 2.
As you can see, this screen
is broken up into three panes, typical of most Microsoft Management
Consoles, with tree navigation on the left pane, details of the selected
object in the middle pane, and actions in the far-right pane. As you
navigate the tree or components regarding your website, your details and
actions will change.
When you first click your
server in the IIS Management Console, your IIS Management Console will
show only the components you have currently installed for IIS. With a
default installation of IIS only, you will notice your management screen
will be broken into three areas: ASP.NET, IIS, and Management. This
allows you to navigate quickly around the areas on your IIS server you
want to manage. You can also change the view to Category or just list
the different areas for you to manage on your server. To change how the
IIS management tasks are organized, you can click the Group By option on
the toolbar in the console and select your desired view. In Figure 3, you can see an example of an IIS server with ungrouped tasks.
When you click a site, you
will see several of the same administrative tasks you can perform. When
you are working with sites, it's important you select the proper level
you want to administer. When you first select the server level, all the
changes you make will impact the websites on the server. However, you
can override the settings by making changes at the website level. The
website level allows you to have customized settings of that website.
One of the things you will
notice is the tasks all work the same way, and once you learn how to
manage tasks at the server level, it is quite easy to apply the same
knowledge to the website level. Table 1 describes some of the common tasks you can perform when managing IIS.
Table 1. Common IIS Tasks
Task Name | Description |
---|
Authentication | This
allows you to control which authentication mechanisms are currently
enabled. As you may recall, when you install IIS, you can have multiple
authentication methods installed. With the Authentication task, you can
control which sites use which authentication mechanism. |
Default Document | Default
Document is an important setting for you to use when users connect to a
website or server but do not specify a specific page. The default
document is what is displayed. You can list many default documents to be
used, and they are processed in order. |
Error Pages | When
a user encounters an error on your web server or site, you can
customize the error messages that users will see. This provides you with
a tool to assist the user but also to assist your troubleshooting
efforts. |
Handler Mappings | Handler mappings work similarly to file extensions for documents. For example, when you double-click an .xlsx
file, Excel opens. In the web server handler, mappings work with
requests for applications. For example, if you open a web page, IIS will
know to open the page and, if necessary, open the proper application as
in the case of .php websites, for example. |
Logging | If
you have installed the logging role service, you will be able to
control the default location, how log files are generated, and when
logging will occur. |
Management Service | If you have installed the remote management service, you will be able to configure the service with this task. |
Request Filtering | Request
filtering allows you to work with and filter content based on protocol
or even IP settings. This essentially allows you to set what content
will be served to users of your websites. |
1.1. Work with Failed Request Tracing Rules
One of the tasks you can use to
help troubleshoot errors on your web server is failed request tracing.
To be able to take advantage of failed request tracing, you need to
install the Tracing role service of IIS.
To open Server Manager, click Start => Administrative Tools => Server Manager.
In Server Manager, click + next to Roles.
Right-click Web Server (IIS), and select Add Role Services.
Select Tracing, and click Next.
Review the summary screen, and click Install.
Review the installation summary, and click Close.
Once you have successfully
installed the Tracing role service, you will be able to trace requests
to your websites that have failed. This allows you to set certain rules
and conditions that, when met, allow you to see what happened and why
the error occurred. You can then, ideally, track down the source of the
error.
You can create failed request
tracing rules at the server level or the site level. However, by default
failed request tracing is not enabled at the site level. To enable
failed request tracing, you need to modify the site settings:
To open the IIS Management Console, click Start => Administrative Tools => Internet Information Services (IIS) Manager.
In the navigation tree, click Sites.
Click the site on which you want to enable failed request tracing.
In the Actions pane on the right, click Failed Request Tracing; you will see a screen similar to Figure 4.
Click Enable, and set your directory for the log and how many trace files you want to maintain.
Click OK; you will then be able to create tracing rules.
Creating tracing rules at the
web server or site level follows the same procedures; the only
difference is the scope of the rule. Creating failed request tracing
rules follows a similar procedure to creating an email rule:
To open the IIS Management Console, click Start => Administrative Tools => Internet Information Services (IIS) Manager.
In the navigation tree, click the server or sites you want to manage.
Double-click Failed Request Tracing Rules in the center pane.
In the Failed Request Tracing Rules screen, click Add in the right Actions pane.
Select the content you want to look for, and click Next.
On
the Conditions screen, set the conditions you are looking to trace; you
can trace status codes, timeouts, and even the severity level. Before
you can continue, you must select either Status Code or Time Taken. Even
though these are check boxes that do not seem to be dependent on each
other, one of the first two must be selected even if you just want the
event severity. When you are done selecting your conditions, click Next.
In
the Trace Providers step, you can select which providers you want to
trace and to what level of detail you want to see in your log. The more
verbose your logs, the bigger the files, but the better chance for you
to trace the error. When you are done, click Finish.