IIS虚拟目录到远程服务器共享文件夹:路径可能不存在且无法验证 [英] IIS Virtual Directory to remote server shared folder: The path might not exist and could not be verified

查看:3110
本文介绍了IIS虚拟目录到远程服务器共享文件夹:路径可能不存在且无法验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法让我的IIS网站上的虚拟目录指向远程文件服务器上的共享物理文件夹,以获取爱情和金钱。我在网站计算机和文件服务器计算机上设置了相同的(相同名称和密码)管理员用户,使该用户成为网站的IIS站点应用程序池上的应用程序池标识所有者,并授予该用户访问该用户的权限。 REMOTE文件服务器上的共享文件夹,并与该特定用户共享。当我尝试使用Web服务器计算机上的IIS在我的网站中创建指向远程文件服务器共享文件夹的虚拟目录时,每次都可以正常进行身份验证,但无法找到路径。我尝试了很多UNC的组合,甚至是防火墙规则。



不好。



我有一个开发盒和一个生产Web服务器都运行相同的IIS .NET网站(在我的开发盒上使用IIS 10版本1607,在生产中使用IIS 7)服务器)。 (请注意,Web和文件服务器生产框在VMWare虚拟机上运行。)



我有一个安全共享文件夹我需要Web服务器到将文件放在单独的/其他远程 Windows 2012服务器上。



以下内容适用于我的Web服务器位于我的开发环境中的情况系统(Windows 10),以及它在生产服务器(Windows Server 2012 R2)上的位置。我做了以下事情:



1。在Web服务器和远程2012R2文件服务器系统上设置具有相同名称和相同密码的管理帐户。





1。我将远程2012R2文件服务器系统上的文件夹共享给特定的人 - 1中提到的管理用户。





2。我将此管理用户设置为Web服务器上IIS网站上的应用程序池所有者





3。我尝试从Web服务器创建一个虚拟目录,使用其IP地址作为服务器名称指向远程文件服务器上的共享文件夹,并使用传递身份验证(请记住,IIS池标识与管理用户相同存在于两台计算机上)和特定的用户登录选项(即我尝试过两者)





5。我一直得到这个错误:





<这是什么?我是否需要远程文件服务器上的防火墙规则? MS文件不要说我这样做。 防火墙这个词在这个页面上甚至没有出现过一次:



我还:


  1. 使Web2012Tx用户成为文件夹中共享文件夹的OWNER - > properties-> security-> advanced

  2. 使Web2012Tx用户成为所有者共享文件夹的父文件夹。

  3. 关闭并重新启动IIS网站并多次回收应用程序池。

它没有说我应该共享共享文件夹的父文件夹,事实上MS共享说明说不这样做。



不幸的是这个



这也没有(恰当地打开网络共享可见性):





防火墙的这些调整也不起作用:





更新:



所以现在在生产盒Web服务器上我获得了良好的身份验证/凭证和文件夹访问测试,但仍无法通过IIS访问!






我们拥有强大的安全性和非常小的安全表面积,但我需要这个安全的共享功能。

解决方案

好奇,你有没有解决这个问题?我遇到了类似的问题,这是由于在NAS上使用DFS,即DFS别名被用作UNC路径(在故障转移场景中,DFS别名被重新命名为备份存储)。



当我将连接更改为指向相对存储路径时,它工作正常,例如而不是\ DFS12345 \ x \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\理想的是,如果你有跨越数据中心的存储,每个存储都有不同的UNC路径。出于开发目的,可能无关紧要。



DFS可能有问题 - 如果您使用它(?),请尝试将用户帐户添加到根级别如果您是DFS组。



快速测试以确定此问题:



打开cmd提示并运行这些命令(显然是uncpath =你的路径)



mkdir \uncpath \ test1 *这应该有效



mkdir \uncpath \ test2 \ test3 \ test4 **这可能会失败



如果在运行多个目录时,返回的结果是:
'无法创建目录或文件',然后我怀疑您有DFS权限问题。解决方法是使用相对存储路径,或创建存储路径的DNS别名,或将用户帐户添加到顶级DFS组。



希望这有助于: - )


I cannot get the virtual directory on my IIS website to point to a shared physical folder on a remote file server for love nor money. I set up the same (same name and password) admin users on the web site computer and the file server computer, made that user the application pool identity owner on the IIS site application pool for the website, and gave that user permission to access the shared folder on the REMOTE file server, and shared with that specific user. When I try to create a virtual directory in my website pointing to the remote file server share folder using IIS on the web server computer, the authentication works fine every time but the path cannot be found. I have tried many combinations of UNC, and even a firewall rule.

No good.

I have a dev box and a production web server both running the same IIS .NET website (using IIS 10 Version 1607 on my dev box, and IIS 7 on the production server). (Note that the web and file server production boxes are running as/on VMWare Virtual machines.)

I have a securely shared folder I need the web server(s) to put files in on a separate/other remote Windows 2012 server.

The following applies to both the case where my web server is on my dev system (Windows 10), and where it is on the production server (Windows Server 2012 R2). I did the following:

1. Set up an administrative accounts with the same name and same password on both the web server(s) and the remote 2012R2 file server system.

1. I shared a folder on the remote 2012R2 file server system to a specific person - the administrative user mentioned in 1.

2. I made this administrative user the application pool owner on the IIS web site on the web server(s)

3. I attempted to create a virtual directory from the web server to point to the shared folder on the remote file server using its IP address as the server name, and using both the pass through authentication (remember the IIS pool identity is the same administrative user that exists on both computers) and specific user login options (i.e. I tried both)

5. I get this error consistently:

What IS this? Do I need a firewall rule on the remote file server? The MS docs DON'T say that I do. The word 'firewall' does not even appear once on this page: https://support.microsoft.com/en-us/help/308150/how-to-create-a-virtual-directory-on-an-existing-web-site-to-a-folder-that-resides-on-a-remote-computer And the word 'firewall' does not appear once on this page either: https://msdn.microsoft.com/en-us/library/bb763173.aspx

There is nothing in this page about firewalls or remote physical directories either: https://technet.microsoft.com/en-us/library/cc771804.aspx

So, having followed the instructions I am stumped with regards to what I missed.

I have tried lots of combinations of UNC (maybe I still missed one?):

\\XXX.XXX.XXX.XXX\servername\_files
\\XXX.XXX.XXX.XXX\_files
\\XXX.XXX.XXX.XXX\subf\_files
\\XXX.XXX.XXX.XXX\\_files
\\XXX.XXX.XXX.XXX\\subf\_files
\\XXX.XXX.XXX.XXX\_files
//XXX.XXX.XXX.XXX/servername/_files
//XXX.XXX.XXX.XXX/subf/_files
//XXX.XXX.XXX.XXX/_files

_files (file://servername/_files)

No good.

I also:

  1. Made the Web2012Tx user the OWNER of the shared folder in folder->properties->security->advanced
  2. Made the Web2012Tx user the OWNER of the shared folder's parent folder.
  3. Shutdown and restarted the IIS website and recycled the application pool multiple times.

NOwhere does it say that I should share the parent folder of the shared folder, and in fact the MS sharing instructions say not to do so.

Unfortunately this IIS7 Accessing Network Share did nothelp.

So to summarise, the Web2012Tx user is an admin on all systems with the same password on all, with full security access and ownership of the shared folder on the file server, and is assigned as the IIS application pool owner for the websites on the web server computers. The folder on the file server is specifically shared with that specific user. There is no authentication problem, but the IIS virtual directory still cannot be created because the shared folder is apparently not visible??`

Do I need a firewall rule? What kind? Do I need IIS on the file server (I do not think this is right at all) Is it my UNC structure? (this is possible)

The only other thing I can think of is that the production Web and file servers are on VMWare VMs, but that should be transparent to the task at hand.

UPDATE:

This did not help (installing share resource manager on file server Windows 2012 R2 box where the shared folder is):

Nor did this (opening up the network share visibility appropriately):

Nor did these adjustments to the firewall work:

UPDATE:

So now on the production box web server I get good authentication/credential and folder access test, but still no access through IIS!

We have strong security with and a very small well securfed surface area, but I need this secure share for function.

解决方案

Just curious, did you get this resolved? I encountered a similar problem, it was due to the use of DFS on the NAS i.e. a DFS alias was used as the UNC path (The DFS alias gets repointed to the backup storage during a failover scenario).

When I changed the connection to point to the relative storage path it worked fine e.g. instead of \DFS12345\x\y\z\myshare I used \NASFiler12345\myshare$ etc

However in a failover scenario this might not be ideal i.e. if you have storage across datacentres with different UNC paths for each. For development purposes then possibly it doesn't matter.

DFS can be problematic - that's if you are using that(?), try adding the user account to the root level DFS group if you are.

A quick test to identify this problem:

Open a cmd prompt and run these commands (the uncpath = your path obviously)

mkdir \uncpath\test1 *this should work

mkdir \uncpath\test2\test3\test4 **this may fail

If when running the multiple directory creation the result returned is: 'The directory or file cannot be created', then I suspect you have a DFS permission problem. The workaround is to use the relative storage path, or create a DNS alias to the storage path, or add the user account to the top level DFS group.

Hope this helps :-)

这篇关于IIS虚拟目录到远程服务器共享文件夹:路径可能不存在且无法验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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