我正在尝试在IIS 7.5中为匿名访问添加目录.它适用于Web Dev,但不适用于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>
Run Code Online (Sandbox Code Playgroud)
更新:
我已经转到该文件夹并在身份验证下,我已经将IIS_USR中的匿名身份验证更改为池.这似乎是正确的.
我会奖励那些为理解这个环境提供非常好的解释和资源的人.此外,如何全局应用它将很有用 - 对于所有文件夹.
既然你回答了自己的问题,这里的解释可能有所帮助
授权处理IIS将为其提供资源的人员.但是,这些资源有自己的安全性,因为它们只是文件系统上的文件.
配置中的Authentication元素有助于确定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>
Run Code Online (Sandbox Code Playgroud)
在anon上.auth方法,用户名字段是IIS在访问资源时将模拟的对象.如果未指定,则默认使用apppool的标识.
现在,至于为什么这很重要...检查磁盘上的实际文件(.css).如果这解决了问题意味着IUSR无权读取该文件.
| 归档时间: |
|
| 查看次数: |
14027 次 |
| 最近记录: |