IIS7 权限被拒绝 - ASP 文件写入
不幸的是我没有这方面的大量信息。 我有一位客户已将其站点从古老的系统迁移到 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
提供的答案是正确的,但我需要更多关于如何完成它的细节。为了使它变得非常简单,请按照以下步骤操作。我正在 Intranet 的沙箱系统上设置一个 ASP 页面计数器。
管理
应用程序池
右键单击 DefaultAppPool 并
选择高级设置。在看
流程模型部分。
设置为 ApplicationPoolIdentity。
这是一个内置帐户。
可以使用内置用户
机器名\IUSR 为您的
权限设置。我不得不
指定机器名称,因为
这是一个虚拟化服务器,YMMV。
该用户名代表您的权限
设置。
到 Windows 资源管理器,到文件夹
需要添加权限的地方。
设置。
您确定的非默认用户名
在上面的步骤 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.
Management
Application Pools
right-click on DefaultAppPool and
choose Advanced Settings. Look in
the Process Model section.
set to ApplicationPoolIdentity.
This is a built-in account.
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.
that username for your permissions
settings.
to Windows Explorer, to the folder
where you need to add permission.
settings.
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/
这个建议是正确的。如果由于任何配置原因,解决方案的路径不是显而易见的,请尝试运行 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.
我在 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.
花了一些时间做类似的事情。即使设置正确,它也不起作用。
然后我尝试首先在服务器上创建实际文件。事实证明这一招奏效了。现在我的 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.