简体   繁体   English

无法访问iis7 mvc app中的文件 - server 2008 r2

[英]No access to files in iis7 mvc app - server 2008 r2

I've just installed windows server 2008 r2 along with visual studio and dropbox. 我刚刚安装了windows server 2008 r2以及visual studio和dropbox。 I'm using it as a VM for development and dropbox helps me keep my files in sync with other machines. 我正在将它用作开发的VM,而dropbox可以帮助我保持文件与其他机器同步。

I've got my site set up in IIS but I'm getting an access denied error when trying to view the site. 我已经在IIS中设置了我的站点但是在尝试查看站点时我收到了拒绝访问的错误。 I've had this before and to get around it in the past I've gone through and added the IIS_User account to the list of permissions to read/modify the files. 我之前已经有了这个,并且过去常常解决这个问题,并将IIS_User帐户添加到读取/修改文件的权限列表中。 I assume because the file's have been copied down with drop box the files don't have the necessary permissions. 我假设因为文件已经用drop box复制下来,文件没有必要的权限。 Here's the bugger, I can't batch update the files by modifying permissions on a folder, I'm having to do it right to the file level and even worse, one at a time! 这是bugger,我不能通过修改文件夹的权限来批量更新文件,我必须直接对文件级别进行操作,更糟糕的是,一次一个! I can't have this. 我不能拥有这个。

I'm relatively new to 2008 r2 and IIS 7 so I have no idea what's happening here. 我对2008 r2和IIS 7比较新,所以我不知道这里发生了什么。 Can someone explain what is going on and if there's an IIS/file permission setting I can update to resolve it at the top level folder? 有人可以解释发生了什么,如果有IIS /文件权限设置我可以更新以解决它在顶级文件夹?

I've tried adding anonymous permssions on the website in IIS and I've added permissions on the folder for IIS_User (even Everyone). 我已经尝试在IIS中的网站上添加匿名权限,并且我已经为IIS_User(甚至每个人)添加了文件夹的权限。 I have an Administrator account and that's already set to allow me to read/write/modify the files. 我有一个管理员帐户,已经设置为允许我读/写/修改文件。

This is typically the message I'm getting 'An error occurred loading a configuration file: Access to the path X is denied'. 这通常是我收到的消息'加载配置文件时出错:拒绝访问路径X'。

This is happening on ascx & aspx files as well as config files. 这发生在ascx和aspx文件以及配置文件上。

Edits: The site is visible when debugging from Visual Studio. 编辑:从Visual Studio调试时,该站点可见。 The site is operating in Full Trust (internal) 该网站以完全信任(内部)运营

Please help, this is stopping me from working and driving me insane! 请帮助,这是阻止我工作,让我疯了!

By default in IIS 7, websites run as the local system's network account (NetworkService), not as IIS_User. 默认情况下,在IIS 7中,网站作为本地系统的网络帐户(NetworkService)运行,而不是作为IIS_User运行。

To verify, in IIS Manager, select the Site in question, click Basic Settings... and check the Application Pool it is assigned to. 要验证,请在IIS管理器中选择相关站点,单击“基本设置...”,然后选中“分配给它的应用程序池”。 Then go into Application Pools and check the Identity for that Application Pool. 然后进入应用程序池并检查该应用程序池的标识。 Make sure that user listed is in the ACL. 确保列出的用户在ACL中。

Adding Everyone to the ACL should work instead, but just in case I would suggest you check the above. 将所有人添加到ACL应该可以正常工作,但以防万一我建议您检查以上内容。 Also of course make sure when you set the ACL to check the box for resetting inheritance on all subfolders, if that is appropriate for your application. 当然,当您设置ACL时,请确保在所有子文件夹上选中重置继承的复选框,如果这适用于您的应用程序。

You could also try setting the identity of the application pool to a local (or domain) user you have created which has access to your application directory. 您还可以尝试将应用程序池的标识设置为您创建的可以访问应用程序目录的本地(或域)用户。

Hope that helps. 希望有所帮助。

Regarding whether other identities would work for your app pool, that depends entirely on whether those identities have permissions to all the files and/or databases and other resources you application needs to access. 关于其他身份是否适用于您的应用程序池,这完全取决于这些身份是否具有对应用程序需要访问的所有文件和/或数据库以及其他资源的权限。 Right now you have the application running under your user account, which is generally not recommended. 现在,您的应用程序在您的用户帐户下运行,通常不建议这样做。 IIS has your password cached, and if you change it, your application will stop working until you update the application pool configuration. IIS已缓存您的密码,如果您更改它,您的应用程序将停止工作,直到您更新应用程序池配置。

As far as setting NTFS permissions, it can get tricky. 至于设置NTFS权限,它可能会变得棘手。 Once you have disabled permissions inheritance, that file or folder will need to be updated individually every time you need a permission change. 一旦禁用了权限继承,每次需要更改权限时,都需要单独更新该文件或文件夹。 The flip side of this is that you cannot remove inherited entries on an ACL, you can only add to them. 另一方面,您无法删除ACL上的继承条目,您只能添加它们。 However you can design a strategy that offers a baseline level of permission at the root of a file structure, and then add permissions to subfolders/files. 但是,您可以设计一个策略,在文件结构的根目录下提供基准级别的权限,然后向子文件夹/文件添加权限。

In order to check & reset inheritance on a folder, go into its properties, security tab, click advanced, then click Edit. 要检查并重置文件夹的继承,请转到其属性,安全选项卡,单击高级,然后单击编辑。 You can see whether this folder inherits permissions from its parent, and optionally wipe out all subfolder/file permissions and enable inheritance on all child folders & files. 您可以查看此文件夹是否从其父文件夹继承权限,并可选择清除所有子文件夹/文件权限并在所有子文件夹和文件上启用继承。

Hope this helps. 希望这可以帮助。

高级安全设置对话框

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows Server 2008 R2 + IIS7:.mp4文件无法播放 - Windows Server 2008 r2 + IIS7: .mp4 files can not be played 将.net 2.0应用程序从Windows Server 2003 / iis6迁移到Windows Server 2008 R2 / iis7 - migrate .net 2.0 app from windows server 2003/iis6 to windows server 2008 R2/iis7 正在显示type =“ hidden” textinput控件/ IIS7,MS Server 2008 R2是配置 - type=“hidden” textinput controls are being shown / IIS7, MS Server 2008 R2 is the configuration 使用受信任的连接使用IIS7从DMZ Web服务器连接到内部SQL Server 2008 R2? - Connecting to internal SQL Server 2008 R2 from DMZ web server using IIS7 using a trusted connection? 在Windows Server 2008 R2上将asp.net应用程序从IIS 6移动到IIS 7之后,IIS 7不允许在本地保存doc / execl文件 - after moving the asp.net app from IIS 6 to IIS 7 on windows server 2008 R2 IIS 7 is not allowing to save the doc/execl files locally 在Server 2008 R2上的本地IIS中调试ASP.Net MVC - Debugging ASP.Net MVC in local IIS on Server 2008 R2 在 IIS 7 Windows Server 2008 R2 Enterprise SP2 上激活 MVC Web 站点 - Activate MVC Web site on IIS 7 Windows Server 2008 R2 Enterprise SP2 IIS7 Windows 2008 R2 w3wp.exe不释放内存 - IIS7 Windows 2008 R2 w3wp.exe not releasing memory IIS窗口Server 2008 R2上未显示Crystal报表 - Crystal Report Not Displyed on IIS window Server 2008 R2 在Windows Server 2008 R2上将.Net Framework与IIS集成 - integrating .Net Framework with IIS on windows server 2008 r2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM