加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

iis-7 – PUT和DELETE在Windows 2008 Server IIS 7和7.5中为asp.

发布时间:2020-12-14 02:04:44 所属栏目:Windows 来源:网络整理
导读:我在使用 Windows 2008服务器IIS进行PUT / DELETE时遇到500 – 内部服务器错误.我得到的回应是: html xmlns="http://www.w3.org/1999/xhtml"headmeta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/title500 - Internal server error
我在使用 Windows 2008服务器IIS进行PUT / DELETE时遇到500 – 内部服务器错误.我得到的回应是:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>500 - Internal server error.</title>
<style type="text/css">
<!--
Formatting 
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>500 - Internal server error.</h2>
  <h3>There is a problem with the resource you are looking for,and it cannot be displayed.</h3>
 </fieldset></div>
</div>
</body>
</html>

当我检查我的WebAPI的自定义日志时,我发现该呼叫甚至没有命中该服务.

我之前的经验是获得了404 – 找不到PUT和DELETE,这种行为在Win7和Win 2008 Server中是一致的.对于那个I found this fix:

我在Windows 7上应用了修复和PUT / DELETE工作.但是之后在win2008服务器上的IIS 7上部署相同的服务时,我没有得到400.但是我甚至在此之前从IIS得到“500 – 内部服务器错误” .

相同的代码在Windows 7(IIS 7.5)上完美运行.

解决此类问题的任何线索?

2012年8月29日编辑:

通过在IIS7中启用故障跟踪来检测500内部服务器错误的问题.修复是这种配置.

<modules runAllManagedModulesForAllRequests="true">
  <remove name="WebDAVModule" />
</modules>
<handlers>
  <remove name="WebDAV" />
</handlers>

基本上我们需要从模块中删除“WebDAVModule”,并从Handler中删除“WebDAV”.但现在我回到我的旧版404-Not Found.现在即使具有以下配置,我也无法使PUT / DELETE工作:

<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*" verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />

异常相同的Web应用程序可以在同一系统相同的IIS上单独托管(不在默认网站下).所以我怀疑这是由于一些父网站配置过滤PUT / DELETE请求.

有什么想法吗?

解决方法

我更准确地使Neil S`信息:

>从“模块”中删除WebDAV
>从“处理程序映射”中删除WebDAV
>我从IIS组件中删除WebDAV以确保WebDAV不存在并重新启动Windows
>转到“处理程序映射”并找到ExtensionlessUrlHandler(对于32和64以及Integrated),打开它并转到“请求限制”到第二章“动词”并将所需的一些方法放到字符串中.我有下一个:
GET,PUT
我重复三个“ExtensionlessUrlHandler”状态的更改.
>我不更改请求筛选设置

因此,Put方法的404和405错误消失了,我收到200状态.

这个解决方案适合我.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读