IIS7 权限被拒绝 - ASP 文件写入

发布于 2024-10-08 10:06:41 字数 601 浏览 1 评论 0原文

不幸的是我没有这方面的大量信息。 我有一位客户已将其站点从古老的系统迁移到 Windows 2008 Server 上的 IIS7。有关错误的信息如下:

错误: E:\wwwroot\sp\xxx\online_data.xls Microsoft VBScript 运行时错误“800a0046”

权限被拒绝

/xxx/oat/exceldata.asp,第 52 行

代码:

49 response.write(server.mappath("online_data.xls")) 
50   
51 set fso = createobject("scripting.filesystemobject") 
52 Set act = fso.CreateTextFile(server.mappath("online_data.xls"), true) 

到目前为止唯一的建议是:

授予应用程序池 (默认应用程序池/经典应用程序池)的 模拟身份读写 物理文件夹的权限 asp 页面所在的位置

当我访问时会查看此内容,但其他建议将不胜感激。

Unfortunately I don't have a whole lot of information on this.
I have a customer who has moved their site from an ancient system to IIS7 on Windows 2008 Server. Info about the error is below:

Error:
E:\wwwroot\sp\xxx\online_data.xls
Microsoft VBScript runtime error '800a0046'

Permission denied

/xxx/oat/exceldata.asp, line 52

Code:

49 response.write(server.mappath("online_data.xls")) 
50   
51 set fso = createobject("scripting.filesystemobject") 
52 Set act = fso.CreateTextFile(server.mappath("online_data.xls"), true) 

The only suggestion so far is to:

grant the application pool
(DefaultAppPool / Classic AppPool)’s
impersonated identity read and write
permission to the physical folder
which the asp page reside

Will look at this when I get access, but other suggestions would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

回心转意 2024-10-15 10:06:41

提供的答案是正确的,但我需要更多关于如何完成它的细节。为了使它变得非常简单,请按照以下步骤操作。我正在 Intranet 的沙箱系统上设置一个 ASP 页面计数器。

  1. 打开计算机管理。
  2. 深入到 IIS 服务器
    管理
  3. 在“连接”窗格中,单击
    应用程序池
  4. 在“应用程序池”窗格中,
    右键单击 DefaultAppPool 并
    选择高级设置。在看
    流程模型部分。
  5. 默认情况下,Identity 属性是
    设置为 ApplicationPoolIdentity。
    这是一个内置帐户。
  6. 如果它设置为默认值,那么您
    可以使用内置用户
    机器名\IUSR 为您的
    权限设置。我不得不
    指定机器名称,因为
    这是一个虚拟化服务器,YMMV。
  7. 如果未设置为默认值,请使用
    该用户名代表您的权限
    设置。
  8. 取消对话框并返回
    到 Windows 资源管理器,到文件夹
    需要添加权限的地方。
  9. 右键获取权限
    设置。
  10. 设置 machinename\IUSR 或
    您确定的非默认用户名
    在上面的步骤 6/7 中。授予
    根据需要授予权限。

这有助于:
http: //learn.iis.net/page.aspx/140/understanding-built-in-user-and-group-accounts-in-iis-7/

The provided answer is correct, but I needed a little more detail on how to accomplish it. To make it really easy, follow the steps below. I was setting up an asp page counter on a sandbox system in our intranet.

  1. Open Computer Management.
  2. Drill down to the IIS server
    Management
  3. In the Connections pane, click on
    Application Pools
  4. In the Application Pools pane,
    right-click on DefaultAppPool and
    choose Advanced Settings. Look in
    the Process Model section.
  5. By default, the Identity property is
    set to ApplicationPoolIdentity.
    This is a built-in account.
  6. If it's set to the default, then you
    can use the built-in user
    machinename\IUSR for your
    permissions settings. I had to
    specify the machine name because
    this is a virtualized server, YMMV.
  7. If it's not set to the default, use
    that username for your permissions
    settings.
  8. Cancel out of the dialog and return
    to Windows Explorer, to the folder
    where you need to add permission.
  9. Right-click to get Permission
    settings.
  10. Set up machinename\IUSR or the
    non-default username you determined
    in steps 6/7 above. Grant
    permissions as needed.

This helped:
http://learn.iis.net/page.aspx/140/understanding-built-in-user-and-group-accounts-in-iis-7/

情域 2024-10-15 10:06:41

这个建议是正确的。如果由于任何配置原因,解决方案的路径不是显而易见的,请尝试运行 procmon(过滤“online_data.xls”)并查看谁失败了、为什么失败以及他们在什么用户帐户下运行。然后检查 ACL。

The suggestion is correct. If the path to the solution is not immediately obvious for whatever configuration reasons, try running procmon (filter on "online_data.xls") and see who's failing, why, and what user account they run under. Then check the ACLs.

心头的小情儿 2024-10-15 10:06:41

我在 Windows 7 中遇到了类似的问题,我的解决方案是更改身份验证。从 IIS 中,选择站点,转到“身份验证”,禁用“匿名身份验证”并启用“Windows 身份验证”。

I had a similar problem in Windows 7 and my solution was changing the Authentication. From IIS, select the site, go to Authentication, disable Anonymous Authentication and enable Windows Authentication.

梦里寻她 2024-10-15 10:06:41

花了一些时间做类似的事情。即使设置正确,它也不起作用。

然后我尝试首先在服务器上创建实际文件。事实证明这一招奏效了。现在我的 ASP 页面写入现有文件没有问题。

必须是从头开始创建新文档,这是另一个问题。

Spent a bit of time with something similar. Even with the correct settings it wasn't working.

I then tried create the actual file first on the server. Turned out to be the trick that worked. Now my ASP page writes to the existing file no problem.

Must be something about creating a new doc from scratch that is another issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文