ArticleDirectory
- Can I customize the IIS 6 error message?
Can I customize the IIS 6 error message? Q:
On our IIS 6 server, occasionally we must disable production applications.ProgramPool for maintenance. During this period, IIS 6 only sends the most basic messages to the client (as shown below ):
The HTTP Error Log displays the following content:
17:06:33 127.0.0.1 1035 127.0.0.1 80 HTTP/1.1 get/503 1 disabled
From this point, we can see that the error is recorded as 503.1, but the user does not get this information or any other information. We want to customize this error message to display our company logo and provide customers with additional information about when the site will be restored. What should I do?
A:
The IIS 6 architecture introduces the HTTP. sys component that can be run in kernel mode. You can customize many IIS 6 errors, but cannot modify the errors passed by HTTP. sys. There are two reasons for this.
First, you cannot run any user in kernel mode.CodeIs crucial. Many custom error pages are actually scripts or programs that process errors to take specific actions based on the needs of our Organization. If you allow these programs to run in kernel mode with code errors, they may cause serious security or performance problems.
Second, if you do not run the code in kernel mode, you must jump to user mode to execute the code. Which pool should be used because the application pool is unavailable? You need to make many assumptions.
Aside from these complicated issues, I do not deny that it is very useful to send these requests to at least one custom static page.
Before this function appears (I don't know if it will appear), you have other options. One option is to set the second server, which is the clone of the first server used in the NLB group. One of the main advantages of this layout is that the entire server can be taken offline without service interruption.
Or, create the same website on the same server, but use different application pools. Shut down the production site and open the standby site. This is usually easier than you think.
Finally, you can create a simple site to send the "the site is being maintained" message that meets your requirements. Create this site to respond to the same "IP + port number + host title" configuration used on the production site, and configure it as a dedicated application pool for running. Close the production site and open the "Auxiliary" site. After the maintenance is complete, you can close the secondary site and enable the production site.
Any selection allows you to control the operations performed when the site is offline for maintenance.