========================================================================
微软官方解决方案:您无权访问解决
注意:Windows 集成身份验证、Windows NT 质询/响应 (NTCR) 和 Windows NT LAN 管理器 (NTLM) 是相同的,在
本文中作为同义词来使用。
* 当您使用 Windows 集成身份验证(Microsoft Windows NT 质询/响应)时,Internet Explorer 会提示输
入密码。
要使 Internet Explorer 自动验证用户登录和密码并保持安全性,必须满足以下条件:
o 必须在 IIS 的 Web 站点属性中启用 Windows 集成身份验证,也称为 Windows NT 质询/响应。首先
尝试匿名身份验证,然后进行 Windows 集成身份验证、简要身份验证(如果适用),最后进行基本(明文)身份
验证。
o 客户端和 Web 服务器都必须在基于 Microsoft Windows NT 或基于 Microsoft Windows 2000 的同
一个域内,或者在受信任的基于 Windows NT 或基于 Windows 2000 的不同域内(在这些域内可以授予用户帐户访
问基于 IIS 的计算机资源的权限)。
o 用户的浏览器必须是 Internet Explorer。Internet Explorer 是唯一支持 Windows 集成身份验证
(NTCR) 的浏览器。
o Internet Explorer 必须把所请求的 URL 视为 Intranet(本地)。如果所请求的 URL 的计算机名
称部分包含句点(如 http://www.microsoft.com 和 http://10.0.0.1),Internet Explorer 会假定在
Internet 中存在所请求的地址而不自动传递任何凭据。不包含句点的地址(如 http://webserver)被认为在
Intranet (本地);Internet Explorer 会自动传递凭据。唯一的例外是在 Internet Explorer 中的 Intranet
区域内包括的地址。
o Internet Explorer 的 Intranet 区域的安全性设置必须设为“只在 Intranet 区域自动登录”。这是
Internet Explorer 的默认设置。有关 Internet Explorer 安全性区域的其他信息,请单击下面的文章编号,以
查看 Microsoft 知识库中相应的文章:
174360 (http://support.microsoft.com/kb/174360/EN-US/ ) 如何在 Internet Explorer 中使用
安全区域
o 请求 Web 页的用户必须具有访问该 Web 页以及该 Web 页中引用的所有对象的适当的文件系统
(NTFS) 权限。例如,一位用户可能对某个 Web 页具有完全控制权,但如果该 Web 页引用了位于某个安全文件夹
中的图形,他仍会收到输入密码的提示。
* 当您使用基本(明文)身份验证或简要身份验证时,Internet Explorer 会提示输入密码。
当您使用基本(明文)身份验证或简要身份验证时,Internet Explorer 不会自动传递您的用户名和密码。
因此,当您使用这几种身份验证方法时,您总是收到要求凭据的提示。
* 在使用匿名身份验证时,Internet Explorer 提示输入密码。
匿名身份验证从不提示您输入密码,因为 IIS 已经知道匿名帐户的用户名和密码。您收到输入密码的提示
是因为 Internet Explorer 已经被强制使用匿名身份验证以外的其他身份验证方法。发生这种情况是因为匿名用
户帐户(默认情况下是 IUSR_computername)没有获得对以下一个或多个项目的访问权:
o 所请求的文件或 Web 页
o 任何嵌入到该文件或 Web 页中的所请求的对象(例如图形)
o 与所请求的文件或 web 页相关联的 ISAPI 扩展名(例如,.shtml 文件)
=================================================================
Failed to access IIS metabase解决
由于先安装NET 再安装IIS造成 重新装NET即可
我的NET安装目录
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
然后在CMD中输入 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727> aspnet_regiis –u
卸载后再输入 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727> aspnet_regiis –i
大功告成
=================================================================
virtual directory not being configured as an application in IIS. 解决
路径设置不合理可能会出现这样的情况
虚拟路径的设置 应该到该web.config所在的那一级文件夹,否则会有冲突,具体原因在后面
EX:我的网站在D:\My Documents\Visual Studio 2008\Projects\WebSiteSQL1\PrecompiledWeb\WebSiteSQL1里面
那么虚拟路径也应该设置为这个文件夹
Configuration Error Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message:It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
解决方法:
情况1:When you create an new web application using visual studio.net, it automatically creates the virtual directory and configures it as an application.
However, if you manually create the virtual directory and it is not configured as an application, then you will not be able to browse the application and
may get the above error. The debug information you get as mentioned above, is applicable to this scenario.
To resolve it, Right Click on the virtual directory - select properties and then click on "Create" next to the "Application" Label and the textbox. It will
automatically create the "application" using the virtual directory's name. Now the application can be accessed.
当使用.net创建一个新的web程序时,通常会自动的创建虚拟目录并设置为网站程序。
但是如果你手工创建虚拟目录而没有设置为网站程序,你就不能浏览网站的网页并出现上述的错误。
右键单击“默认网站”->新建->虚拟目录,将虚拟目录指向程序所在处,设置网站程序,就可以访问了。
情况2:When you have sub-directories in your application, you can have web.config file for the sub-directory. However, there are certain properties which cannot
be set in the web.config of the sub-directory such as authentication, session state (you may see that the error message shows the line number where the
authentication or sessionstate is declared in the web.config of the sub-directory). The reason is, these settings cannot be overridden at the sub-directory level
unless the sub-directory is also configured as an application (as mentioned in the above point).
Mostly we have the practice of adding web.config in the sub-directory if we want to protect access to the sub-directory files (say, the directory is admin and we
wish to protect the admin pages from unathorized users).
But actually, this can be achieved in the web.config at the application's root level itself, by specifing the location path tags and authorization, as follows:-
<location path="Admin">
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</location>
However, if you wish to have a web.config at the sub-directory level and protect the sub-directory, you can just specify the Authorization mode as follows:-
<configuration>
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</configuration>
Thus you can protect the sub-directory from unauthorized access.