[英]Runtime Error when accessing virtual directory on remote server IIS7
I'm having issues with a virtual directory mapped to a folder on a remote server. 我遇到了映射到远程服务器上的文件夹的虚拟目录的问题。 Basically what I want to do is to fetch an xml file located on the remote server through a request to a web server, eg http://example.com/Archive/file.xml , where "Archive" is a virtual directory pointing to a folder on the remote server.
基本上我想做的是通过对Web服务器的请求获取位于远程服务器上的xml文件,例如http://example.com/Archive/file.xml ,其中“Archive”是指向的虚拟目录远程服务器上的文件夹。 I'm not using application/pass-through authentication.
我没有使用应用程序/传递身份验证。
When the virtual directory points to a local folder on the web server machine everything works fine. 当虚拟目录指向Web服务器计算机上的本地文件夹时,一切正常。
I have another site running on the same server, difference being that this other site (where the virtual directory mapping to the remote server works fine) is a Web Forms site and the one I'm having trouble with is a .NET MVC site. 我有另一个站点在同一台服务器上运行,区别在于这个其他站点(映射到远程服务器的虚拟目录工作正常)是一个Web窗体站点,而我遇到问题的是一个.NET MVC站点。 My first idea was that there's something fishy with routes configured for the MVC site, but in that case it wouldn't work when the archive is mapped to a local folder (I suppose).
我的第一个想法是,为MVC站点配置了路由,但是在这种情况下,当归档被映射到本地文件夹时(我想),它将无法工作。
So, the question, what am I missing? 所以,问题是,我错过了什么? It seems to be something in the IIS configuration...
它似乎是IIS配置中的一些东西......
Web server setup: Windows Server 2008 Standard, IIS7, Site running on .NET MVC Web服务器设置: Windows Server 2008 Standard,IIS7,在.NET MVC上运行的站点
File server setup: Windows Server 2008 Standard 文件服务器设置: Windows Server 2008 Standard
(both servers are on the same subnet and can reach each other on 192.168.0.X) (两台服务器位于同一子网上,可以在192.168.0.X上相互访问)
Edit: After adding a web.config to the folder on the remote server, I get this error instead. 编辑:将web.config添加到远程服务器上的文件夹后,我收到此错误。 Permissions are, from what I can tell, correctly configured:
根据我的说法,权限是正确配置的:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: An error occurred loading a configuration file: Failed to start monitoring changes to '\\fileserver\c$\inetpub\wwwroot\Archive\fileDir' because access is denied.
Source Error:
[No relevant source lines]
The web.config in fileDir looks like this: fileDir中的web.config如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
</staticContent>
</system.webServer>
Looking in the Windows Event Viewer I find the following application error: 查看Windows事件查看器,我发现以下应用程序错误:
Failed to start monitoring changes to '\\fileserver\c$\inetpub\wwwroot\Archive\fileDir' because access is denied.
Just an update as I found this old question and remember how it was solved: 只是一个更新,因为我发现了这个老问题,并记住它是如何解决的:
The problem was with our internal DNS server which has been a pain ever since it was introduced. 问题在于我们的内部DNS服务器自推出以来一直很痛苦。 Accessing the remote directory on its IP instead solved the problem.
访问其IP上的远程目录代替了解决问题。
Cheers! 干杯!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.