码迷,mamicode.com
首页 > 其他好文 > 详细

Troubleshooting Failed Requests Using Tracing in IIS 8.5

时间:2017-12-07 18:53:26      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:machine   png   ppc   .com   example   hat   lang   xsl   failed   

https://docs.microsoft.com/en-us/iis/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis

https://docs.microsoft.com/en-us/iis/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis-85

Make a Backup

You must make a backup of the configuration before doing the following tasks.

以管理员权限打开命令工具

C:\Windows\system32>%windir%\system32\inetsrv\appcmd add backup cleanInstall
BACKUP object "cleanInstall" added

 

Disable ASP

ASP must be disabled for this task. ASP is disabled only as an example and for the purposes of the tasks in this article.

这个设置,是在IIS的根目录上设置的

  1. Open IIS Manager and select the server.

双击ISAPI and CGI Restrictions.

  1. In the ISAPI and CGI Restrictions pane, select Active Server Pages. In the Actions pane, click Deny to disable ASP . Active Server Pages will show as "Not Allowed".

 

 

Enable Failed-Request Tracing

Step 1: Enable Failed-Request Tracing for the Site and Configure the Log File Directory

首先需要配置https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/site/tracefailedrequestslogging

技术分享图片

 

After you enable failed-request tracing, you need to configure where the log files will reside.

In this task, you will enable failed-request tracing for the Default Web Site and specify where to put the log files.

You will then configure the failure for which to generate failure logs.

 选择目标website,然后在右侧的面板找到 Failed Request Tracing

技术分享图片

Enable这个功能,可以设置日志文件的路径。默认路径是%SystemDrive%\inetpub\logs\FailedReqLogFiles

 Failed-request tracing logging is now enabled for the Default Web Site.

Check the %windir%\system32\inetsrv\config\applicationHost.config file to confirm that the configuration looks as follows:

<site name="Lisa" id="4" serverAutoStart="true">
<traceFailedRequestsLogging enabled="true" />
</site>

 

Step 2 : Configure Your Failure Definitions

In this step, you will configure the failure definitions for your URL, including what areas to trace.

You will troubleshoot a 404.2 that is returned by IIS for any requests to extensions that have not yet been enabled.

This will help you determine which particular extensions you will need to enable.

For more information, see The HTTP status code in IIS 7.0, IIS 7.5, and IIS 8.0.

  1. In the Connections pane, expand the machine name, expand Sites, and then click Default Web Site.
  2. Double-click Failed Request Tracing Rules.

具体的操作,还是去原文链接看

 

 

Test and View the Failure Request Log File

In this task, you will generate a failed request and view the resulting trace log.

You already configured IIS to capture trace logs for http://localhost/*.asp requests that fail with an HTTP response code of 404.2. Now verify that it works.

打开%systemdrive%\inetpub\logs\FailedReqLogFiles\W3SVC1.

 

Notice a few things here: When IIS writes the failed request log file, it writes one file per failed request.

freb.xsl style sheet is also written, one per directory.

This helps when you view the resulting failure request log files (such as fr000001.xml above).

 

 

 

Restore Your Backup

Now that you have completed the tasks in this article, you can restore the backup of the configuration.

Run the following command with administrator user rights:

console
%windir%\system32\inetsrv\appcmd restore backup cleanInstall

 

 

 

 

 

 

Troubleshooting Failed Requests Using Tracing in IIS 8.5

标签:machine   png   ppc   .com   example   hat   lang   xsl   failed   

原文地址:http://www.cnblogs.com/chucklu/p/8000233.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!