IIS Service Startup (IIS 6.0)
On rare occasions, you might encounter problems related to starting the IIS services infrastructure. The IIS services are generally robust enough to handle problems and recover from them gracefully. If a problem does occur and if it is appropriate, an event is logged to the application/system event log explaining the failure. Typically, the startup process never needs troubleshooting beyond examining messages written to the event log and taking the required corrective action. However, because it is helpful to understand the inner workings of an application in order to recognize problematic behavior, this section describes the major stages of the IIS services infrastructure startup process.
For information about the components of the services infrastructure, see IIS 6.0 Architecture.
The Windows Service Control Manager (SCM) performs Windows operating system service management operations. Among other things, SCM is responsible for signaling services to begin the startup process and for managing service dependencies. Some services are configured to auto-start, which means that SCM asks those services to start when the system is restarted. Other services are configured to manually start (or demand-start), which means that SCM starts those services only when prompted by an external request or when a service dependency demands it.
IIS services startup begins when the computer restarts. The IIS Admin service, which is hosted by Inetinfo.exe, is configured as an auto-start service. This is the first service in the IIS service infrastructure that is asked by SCM to start. The IIS Admin service depends upon the Remote Procedure Call (RPCSS) service and the Security Accounts Manager (SAMSS) service, which means that SCM guarantees that these are started before the IIS Admin service.
The next auto-start service in the IIS services infrastructure that starts is the World Wide Web Publishing Service (WWW service). It is hosted by Svchost.exe. In addition to the IIS Admin and RPCSS services, the WWW service has dependencies on the HTTP SSL (HTTPFilter) service. The IIS Admin service and RPCSS were started earlier, but before SCM starts the WWW service, it needs to demand-start the HTTPFilter service.
The HTTPFilter service has dependencies on the IIS Admin service and the HTTP service. It is this dependency on HTTP that causes SCM to start the HTTP.sys kernel-mode driver. Consequently, SCM starts the HTTPFilter service, which runs in Lsass.exe (or Inetinfo.exe if you are running in IIS 5.0 isolation mode), and then starts the WWW service.
The following sections describe what happens when these services start.
In IIS 6.0, unlike in earlier versions of IIS, the HTTP.sys kernel-mode device driver is not part of the core IIS services. In Windows Server 2003, the HTTP.sys driver actually exposes an API set that any application or service, not just IIS, can leverage. However, since IIS 6.0 is the major client, so to speak, of HTTP.sys, it is beneficial to understand how HTTP.sys relates to IIS 6.0.
The primary responsibility of HTTP.sys is to listen for and respond to HTTP requests on the network endpoints on which it is requested to do so. When HTTP.sys starts, by default it listens for HTTP requests on all IP addresses configured on the system. In some cases, though, it is beneficial for HTTP.sys to listen only on specific addresses — for example, if Windows Media Services needs to listen on port 80 of a specific IP address, outside of the HTTP.sys driver. To accommodate this need, HTTP.sys has an IP inclusion list. This list, when it contains entries, tells HTTP.sys which IP addresses to listen on, and, thereby, which IP addresses not to listen on. At startup, HTTP.sys examines this list and configures itself accordingly. As a result, changes to this list take effect only when the service is restarted.
You can use the HttpCfg.exe utility to configure the IP inclusion list. For information about HttpCfg.exe, in Help and Support Center for Windows Server 2003, click Tools, and then click Windows Support Tools.
IIS Admin Service
The IIS Admin service primarily is responsible for managing the IIS metabase. During startup, it reads the MetaBase.xml file and creates its in-memory representation. Because the IIS Admin service creates this in-memory snapshot, if the metabase file is corrupt or if the XML code in the file is not syntactically well-formed, the IIS Admin service will fail to start. The IIS Admin service is responsible for synchronizing access to the metabase through the various control interfaces, even when manual updates are made directly to the MetaBase.xml file. During startup, the IIS Admin service sets up the control interfaces, like IMSAdmin, and registers for necessary file change notifications from the Windows Server 2003 operating system in order to monitor changes to the XML file.
The WWW service recognizes the following entities:
When the WWW service starts, it performs the following operations:
At this point, IIS can accept incoming HTTP requests. The first HTTP request to an application pool launches the worker process (W3wp.exe). In other words, an application pool can be started even though a worker process is not running.
Worker Process Startup
The fundamental aspects of a worker process startup routine are fairly straightforward. The worker process typically does the following: