IIS 管理用户登录在 7.5 上失败/在 8.5 上工作
IIS Management User Login Fails on 7.5 / Works on 8.5
我有一个小而简单的 ASP.Net 4.5.2 Web 应用程序,其访问权限受到 IIS 管理器用户的限制。父站点是 public(允许匿名/所有用户),应用程序已禁用所有身份验证,并在服务器级别添加 IIS 用户,并在 IIS 授权规则下,如下面的配置所示。这在 IIS 8.5 上完美运行,但在 7.5 上登录失败,显示 401 Unauthorized。
我梳理了角色功能以及站点、服务器和应用程序设置,除了 Win Server 2008 上的 7.5 和 Win Server 2012-R2 上的 8.5 之外,我找不到两者之间的区别。两者都选择了 IIS 管理服务 运行 Windows 和 IIS 管理器用户,并且未选中启用远程连接(仅将其用于应用程序访问,而不是管理)。两者都使用网络服务下的 ASP.Net 4.0 应用程序池,后者对两台服务器上的 Web 文件夹结构拥有完全权限。
我们将不胜感激。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation strict="false" explicit="true" debug="false" targetFramework="4.5.2" />
<customErrors mode="Off" />
<httpRuntime targetFramework="4.5.2" />
<webServices>
<protocols>
<add name="HttpGet" />
<add name="HttpPost" />
</protocols>
</webServices>
</system.web>
<system.webServer>
<handlers>
<add verb="GET,POST" name="About" type="MyApp.About" path="About" />
</handlers>
<modules>
<!-- Replaces Global.asax -->
<add name="AppModule" type="MyApp.AppModule" />
<!-- Required for IIS Manager Users to browse the site -->
<add name="WebManagementBasicAuthentication" type="Microsoft.Web.Management.Server.WebManagementBasicAuthenticationModule, Microsoft.Web.Management, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<defaultDocument enabled="false">
<files>
<clear />
</files>
</defaultDocument>
<directoryBrowse enabled="false" />
<security>
<authorization>
<clear />
<remove users="*" />
<add accessType="Allow" users="IIS.Manager.Username.Here" />
</authorization>
</security>
</system.webServer>
</configuration>
最终发现在新启动的 2008/IIS 7.5 服务器上 Network Service
没有 Read
权限 c:\Windows\System32\inetsrv\
。
我有一个小而简单的 ASP.Net 4.5.2 Web 应用程序,其访问权限受到 IIS 管理器用户的限制。父站点是 public(允许匿名/所有用户),应用程序已禁用所有身份验证,并在服务器级别添加 IIS 用户,并在 IIS 授权规则下,如下面的配置所示。这在 IIS 8.5 上完美运行,但在 7.5 上登录失败,显示 401 Unauthorized。
我梳理了角色功能以及站点、服务器和应用程序设置,除了 Win Server 2008 上的 7.5 和 Win Server 2012-R2 上的 8.5 之外,我找不到两者之间的区别。两者都选择了 IIS 管理服务 运行 Windows 和 IIS 管理器用户,并且未选中启用远程连接(仅将其用于应用程序访问,而不是管理)。两者都使用网络服务下的 ASP.Net 4.0 应用程序池,后者对两台服务器上的 Web 文件夹结构拥有完全权限。
我们将不胜感激。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation strict="false" explicit="true" debug="false" targetFramework="4.5.2" />
<customErrors mode="Off" />
<httpRuntime targetFramework="4.5.2" />
<webServices>
<protocols>
<add name="HttpGet" />
<add name="HttpPost" />
</protocols>
</webServices>
</system.web>
<system.webServer>
<handlers>
<add verb="GET,POST" name="About" type="MyApp.About" path="About" />
</handlers>
<modules>
<!-- Replaces Global.asax -->
<add name="AppModule" type="MyApp.AppModule" />
<!-- Required for IIS Manager Users to browse the site -->
<add name="WebManagementBasicAuthentication" type="Microsoft.Web.Management.Server.WebManagementBasicAuthenticationModule, Microsoft.Web.Management, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<defaultDocument enabled="false">
<files>
<clear />
</files>
</defaultDocument>
<directoryBrowse enabled="false" />
<security>
<authorization>
<clear />
<remove users="*" />
<add accessType="Allow" users="IIS.Manager.Username.Here" />
</authorization>
</security>
</system.webServer>
</configuration>
最终发现在新启动的 2008/IIS 7.5 服务器上 Network Service
没有 Read
权限 c:\Windows\System32\inetsrv\
。