0

我们的实时设置使用 IIS 和虚拟目录来访问存储在另一台服务器上的图像或 pdf 等内容。我们正在尝试使用内置的网络服务器和 CF9 的开发版来设置类似的东西。

到目前为止,我可以成功地使用 cfdirectory 转储远程源上的文件,我必须像我一样让 CF9 应用服务器登录。

我可以将文件夹从远程服务器复制到我的本地 PC 并将虚拟映射条目添加到 jrun-web.xml 并且工作正常,尽管这对于我们的目的并不理想。

<virtual-mapping>
  <resource-path>/login/images/directory/*</resource-path>
  <system-path>C:/Users/[MyUserName]/Desktop/directory</system-path> 
</virtual-mapping>

但是我无法直接映射到该远程服务器。我试过了

<virtual-mapping>
  <resource-path>/login/images/directory/*</resource-path>
  <system-path>\\[remoteServer]\images\directory</system-path> 
</virtual-mapping>

<virtual-mapping>
  <resource-path>/login/images/directory/*</resource-path>
  <system-path>//[remoteServer]/images/directory</system-path> 
</virtual-mapping>

我尝试映射网络驱动器

<virtual-mapping>
  <resource-path>/login/images/directory/*</resource-path>
  <system-path>Z:/images/directory</system-path> 
</virtual-mapping>

所有这些都会导致 /login/images/directory/ 内的任何内容出现 404

4

2 回答 2

3

在我看来,开发应该反映生产。它避免了出现背书问题。我强烈建议您在 db 中使用 IIS,就像您在现场一样。

于 2012-07-02T21:23:31.633 回答
0

Remember that your Apache server will need to have permissions to this directory. ON a windows box you would run apache as a service with a logon account granted "act as a service" permission. The logon account would need to have access to the unc path in question (\servername\blah\blah).

I also think you should be using the alias syntax as in

Alias /images //servername/project

you might need to use front slashes or escaped back slashes as well (I can't find my example) like either //server/blah or \\server\blah.

Hope this helps.

于 2012-07-02T21:31:50.693 回答