2011-02-04 40 views
6

我正在尝试在IIS 7.5中为anon访问添加一个目录。它适用于Web Dev但不支持IIS 7.5为匿名用户授权目录IIS 7.5?

我目前在目录中使用此web.config。这是样式表目录:

<?xml version="1.0"?> 
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use 
    the Website->Asp.Net Configuration option in Visual Studio. 
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
--> 

    <configuration> 
     <appSettings/> 
     <connectionStrings/> 
     <system.web> 
      <authorization> 

       <allow users="*" /> 

      </authorization> 

     </system.web> 
    </configuration> 

更新:

我去了文件夹,并验证下,我从IIS_USR改变匿名身份验证池。这似乎纠正了它。

我会奖励任何为了解此设置提供了非常好的解释和资源的人。另外,如何将其应用于全球,对于所有文件夹而言都是非常有用的。

回答

7

既然你回答了你自己的问题,这里是一个可能帮助

授权涉及谁IIS将提供资源来解释。但是,这些资源具有自己的安全性,因为它们只是文件系统上的文件。

配置中的身份验证元素有助于确定IIS在接受并访问IIS之外/之外的资源后,如何识别用户的请求。

这是在站点级别设置的,通常位于服务器的applicationHost.config文件中。如果设置正确,它可以在站点级别被覆盖。

这个IIS.net网页:

http://www.iis.net/ConfigReference/system.webServer/security/authorization/add

http://www.iis.net/ConfigReference/system.webServer/security/authentication/anonymousAuthentication

你在UI做什么的.config版本是:

<location path="/yourSite"> 
    <system.webServer> 
     <security> 
     <authentication> 
      <anonymousAuthentication enabled="true" username="" /> 
      </authentication> 
     </security> 
    </system.webServer> 
</location> 

在不久。 auth方法,用户名字段是IIS在访问资源时将模拟的用户名。如果不指定其中一个,则默认使用该应用程序池的标识。

现在,至于为什么这么重要...检查磁盘上的实际文件(.css)。如果这解决了这个问题,那将意味着IUSR无法读取该文件。

0

您没有为授权定义的位置。您也不会指定您在web.config中使用的认证类型(如果有的话)。

<location path="/"> 
    <system.web> 
    <authorization> 
     <allow users="*"/> 
     </authorization> 
    </system.web> 
</location>