IIS7访问网络共享 [英] IIS7 Accessing Network Share

查看:162
本文介绍了IIS7访问网络共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PHP 5.4在Windows Server 2008 R2上运行IIS 7。我的一个PHP脚本试图使用UNC路径访问受保护网络共享上的文件。如何将IIS服务帐户更改为有权访问共享的帐户?这在Apache HTTP服务器上很容易做到(你只需更改它),但不清楚如何处理IIS。我该怎么办?

I am running IIS 7 on Windows Server 2008 R2 with PHP 5.4. One of my PHP scripts is trying to access a file on a protected network share using a UNC path. How can I change the IIS service account to an account that has permission to access the share? This is really easy to do on Apache HTTP server (you just change it), but it's not clear how to do with IIS. What can I do?

更新:

我能得到的东西使用我网站基本设置中的连接为选项,然后指定可以访问网络共享的帐户。它出现我的问题与这个问题有关:

I was able to get things working using the "Connect As" option in the "Basic Settings" of my website and then specifying an account that has access to the network share. It appears that my problem is related to this question:

https://serverfault.com/questions/366234/iis-identities-application-pool-vs-connect-as-in-basic -settings

推荐答案

对于在Windows Server 2008 R2上运行的IIS 7 ...在 IIS管理器,选择运行您的网站的应用程序池

For IIS 7 running on Windows Server 2008 R2 ... In the IIS Manager, select the Application Pool under which your Web Site is running.

单击高级设置。将有标识的条目(它位于过程模型部分下)。单击它,为您有权访问共享的帐户提供凭据。

Click "Advanced Settings". There will be an entry for Identity (it is under the Process Model section). Click it, provide credentials for your account that has permission to access the share.

更新

如果您使用的是Active Directory,请确保域帐户,您在正在运行的应用程序池的标识下正确提供。例如, MYDOMAIN \ myAccount

You should make sure that if you are using an Active Directory Domain Account, you provided that correctly under Identity for the running App Pool. For example, MYDOMAIN\myAccount.

进行此更改后,您需要执行以下操作:

After making this change, you will need to do the following:


  1. 停止网站。

  2. 回收您的应用程序池。

  3. 启动网站。

更新II

来自评论在这个答案的讨论中,@ HydroPowerDeveloper能够使用WebSite - >基本设置 - >连接为并在那里设置凭据,使PHP脚本能够通过UNC路径访问网络共享。

From the comment discussion on this answer, @HydroPowerDeveloper was able to get the PHP script to be able to access the network share via UNC path using WebSite -> Basic Settings -> "Connect As" and setting the credentials there.

过去,我一直使用身份的方法通过应用程序池并且允许我的代码通过UNC路径访问网络共享。

In the past, I have always used the approach of setting Identity via Application Pool and that has allowed my code to access Network shares via UNC path.

但是,我在 IIS 上部署的所有站点/应用程序都是基于.NET的WCF或ASPX站点。

However, all of the sites/applications I have deployed on IIS are .NET based WCF or ASPX sites.

我会推测(但不是100%肯定,需要研究/测试确认)身份应用程序池中指定的c> ,而PHP脚本使用连接为。

I would speculate (but am not 100% certain on this, would need research/testing to confirm) that the Identity specified in the Application Pool is used by executing .NET code, whereas the "Connect As" is used by the PHP script.

这篇关于IIS7访问网络共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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