如何在 IIS 上为 ASP.NET 设置正确的文件权限 [英] How to set correct file permissions for ASP.NET on IIS

查看:35
本文介绍了如何在 IIS 上为 ASP.NET 设置正确的文件权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTTP 错误 500.19 - 内部服务器错误无法访问请求的页面,因为该页面的相关配置数据无效.

HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

错误代码:0x80070005
配置错误 : 由于不足,无法读取配置文件权限

Error Code : 0x80070005
Config Error : Cannot read configuration file due to insufficient permissions

当在 IIS 7.5 中添加新的 web 应用程序并运行它时,这个页面显示给我,如何解决这个问题 win7 Ultimate Visual Studio 2010

When add new web application in IIS 7.5 and run it, this page shown to me, how to solve this problem win7 ultimate visual studio 2010

推荐答案

信息很明确.

权限不足无法读取配置文件

Cannot read configuration file due to insufficient permissions

如何解决.

每个 asp.net 应用程序都在分配给它的池下运行,并且每个池都在特定帐户下运行.

How to solve it.

Every asp.net application is run under one pool assigned to it, and each pool is run under a specific account.

打开 IIS,找到您的应用尝试在其下运行的池,查看分配给该池的用户,并在您的完整站点目录树上向该用户授予读取权限.

Open the IIS, locate the pool under which your app is try to run, see the user that is assigned to that pool, and give read permissions to that user on your full site directory tree.

web.config,即消息所说的配置文件,必须具有(和)写入权限.

The web.config, its the configuration file that message says, must have (and) write permissions.

因此,您在站点的根目录中找到 web.config,右键单击它,转到权限并授予池用户写入功能.池用户,是运行池的女巫下的用户,我将在下面解释.

So you locate web.config on the root of your site, right click on it, go to permissions and give on the pool-user, the write capability. The pool user, is the user under the witch the pool is run, as I explain below.

为了能够使用 IIS 运行公共 asp.net 站点,目录中的每个文件都必须具有两个帐户的权限.

To been able to run a public asp.net site with IIS, each file on the directory must have permissions for two accounts.

一个允许公共访问的帐户,以及分配给该应用程序池的帐户.

One account that is permitted for public access, and the account that assigned to that application pool have.

要查找/访问您访问 iis 站点的第一个帐户 |认证 |编辑、查看或更改您在该屏幕截图中看到的内容.

To find/assing the first account you go to your iis site | Authentication | Edit, and see or change it as you see on that screen shot.

现在请注意该名称,我们将在运行池的情况下找到用户.
转到您的 IIS 站点并单击基本设置以查找池名称,然后转到 IIS |应用程序池并查看身份列,并在您的网站运行时记下用户名.

Now note that name and we going to find the user under with the pool run.
Go the your IIS Site and click on the Basic Settings to find the pool name, then go to the IIS | Application Pools and see the Identity column, and note the name of the user under the witch your site is run.

现在我们有两个用户名,我们转到站点的根目录并设置读取的最小权限

Now that we have the two users names we go to the root of the site and set the minimum of permissions that is the read as

  • 如果 IIS_Public_ACCESS_USER 未授予读取权限,则站点将运行,但要求输入密码
  • 在您需要和写入权限的某些目录上,例如,如果您让您的用户上传图像,或保留 App_Data,一些数据库文件.仅适用于您授予的目录以及对 IIS_POOL_USER 的写权限.
  • 某些目录,例如 App_Data 和 App_Code,可以直接抵御 asp.net,它们不允许来自客户端的任何人运行或查看其中的内容.
  • 在允许对用户进行写访问的公共目录上添加一个 web.config 并完全禁用所有 asp.net 文件的运行.

更多阅读给予写权限的目录我被黑了.上传的名为 AspxSpy 的邪恶 aspx 文件.他们还在努力.帮我困住他们‼

More to read for the directories that give write permissions I've been hacked. Evil aspx file uploaded called AspxSpy. They're still trying. Help me trap them‼

这篇关于如何在 IIS 上为 ASP.NET 设置正确的文件权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆