【问题标题】:Default document not being processed when not included in URL未包含在 URL 中时不处理默认文档
【发布时间】:2022-01-21 00:53:17
【问题描述】:

在 JRun(J2EE 安装)、Windows Server 2008 R2、Java 1.6.0_22 上运行 ColdFusion 9,0,1,274733

是否有其他人在获取默认文档index.cfm 以使用 ColdFusion 时遇到问题?我假设这只是我们设置的一个问题;不同的 Web 服务器 (IIS) 和应用程序服务器 (ColdFusion)。我无法想象我们是唯一运行此配置的人。我们是吗?

这就是问题所在。
如果我们请求http://mysite.com/index.cfm,它会起作用。
如果我们请求 http://mysite.com/ 它不起作用,我们会得到 404。

我在我们的 IIS 服务器上检查了 Web 连接器的日志文件,可以看到它正在向我们的 ColdFusion 服务器发送请求。 ColdFusion 服务器正在发回 404 错误代码,但我不知道为什么。我们在 IIS 服务器上为 index.cfm 设置了默认文档。我们还将<welcome-file-list> 设置为在我们的应用程序服务器(web.xml)上包含index.cfm

当我们不包含 index.cfm 时,来自我们的网络连接器日志:

2012-11-01 13:37:22 jrISAPI[4544:3600]  ***HttpExtensionProc for JRun ISAPI Extension: uri is "/test/"
2012-11-01 13:37:22 jrISAPI[4544:3600]     HTTP_HOST: servername
2012-11-01 13:37:22 jrISAPI[4544:3600]  filtering /test/ (/test/) HOST=servername
2012-11-01 13:37:22 jrISAPI[4544:3600]  filterRequest:   no match
2012-11-01 13:37:22 jrISAPI[4544:3600]  ExecUrl: request received: URL=/test/
2012-11-01 13:37:22 jrISAPI[4544:3600]  ExecUrl Completion: 404, ErrorCode=2, URL=/test/.

当我们包含 index.cfm 时,来自我们的网络连接器日志:

2012-11-01 13:49:02 jrISAPI[9936:3600]  ***HttpExtensionProc for JRun ISAPI Extension: uri is "/test/index.cfm"
2012-11-01 13:49:02 jrISAPI[9936:3600]     HTTP_HOST: servername
2012-11-01 13:49:02 jrISAPI[9936:3600]  filtering /test/index.cfm (/test/index.cfm) HOST=servername
2012-11-01 13:49:02 jrISAPI[9936:3600]  filterRequest:   matched *.cfm
2012-11-01 13:49:02 jrISAPI[9936:3600]  ***IISWorkerThreadProc for JRun ISAPI Extension: uri is "/test/index.cfm"
2012-11-01 13:49:02 jrISAPI[9936:3600]     ALL_RAW: Connection: Keep-Alive
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, application (553)
2012-11-01 13:49:02 jrISAPI[9936:3600]  Headers and Values:
... and much more ...

我们已通过使用 IIS 中的 URL 重写模块将 index.cfm 附加到 URL 来解决此问题。它有效,但我的直觉一直告诉我,我们不应该为这样的基本功能这样做。

还有其他人有这个问题吗?你是怎么解决这个问题的?

编辑添加更多信息

这是来自 IIS 服务器的我网站的 web.config 文件内容:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
    <handlers>
        <add name="JWildCardHandler" path="*" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\1\jrun_iis6_wildcard.dll" resourceType="Unspecified" requireAccess="None" />
        <add name="hbmxmlHandler" path="*.hbmxml" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
        <add name="cfswfHandler" path="*.cfswf" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
        <add name="cfrHandler" path="*.cfr" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
        <add name="cfcHandler" path="*.cfc" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
        <add name="cfmlHandler" path="*.cfml" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
        <add name="cfmHandler" path="*.cfm" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
        <add name="jwsHandler" path="*.jws" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
        <add name="jspHandler" path="*.jsp" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
    </handlers>
    <defaultDocument>
        <files>
            <add value="index.cfm" />
        </files>
    </defaultDocument>
    <staticContent>
        <mimeMap fileExtension=".air" mimeType="application/vnd.adobe.air-application-installer-package zip" />
    </staticContent>
</system.webServer>
</configuration>

这里是来自APP服务器web.xml的部分文件内容:

<welcome-file-list id="WelcomeFileList_1034546870672">
    <welcome-file>index.cfm</welcome-file>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
</welcome-file-list>

【问题讨论】:

  • 再澄清一下,Adobe 对此设置的术语是“分布式模式”。当有一个 Web 服务器和另一个不同的 ColdFusion 服务器时。
  • 我不知道为什么人们不赞成这个问题,尤其是在这么长时间之后。您能否发表评论,说明您为什么投反对票?

标签: coldfusion jrun


【解决方案1】:

在 IIS 管理器中尝试为您的网站添加默认文档“index.cfm”。

【讨论】:

  • 感谢您的回答。我已经这样做了。实际上,网络连接器工具会为您执行此操作,但我已验证它存在于我的网站中。但是,我注意到通过 Web 连接器的请求没有附加“index.cfm”。我不确定这是否应该如何工作。我认为 web.xml 的“欢迎文件列表”会在那个时候接管,但它似乎没有。
【解决方案2】:

我还在 Adob​​e 论坛上发布了这个问题,它在那里获得了更多的关注。 You can read all of the details here.

似乎我遇到的主要问题是,一旦确定 ColdFusion 没有“/”映射,IIS 就没有将“/index.cfm”传递给 Web 连接器。这在我在 Web 服务器上创建了一个空白(空)index.cfm 文件后开始工作。我不记得过去在使用分布式模式时必须将 CFM 文件放在 Web 服务器上。任何人都可以确认或否认 CFM 文件需要驻留在两台服务器上才能正常工作(无论如何都不使用重写规则)?

【讨论】:

    【解决方案3】:

    我参加这个聚会有点晚了,但我一直在开发一个系统,我需要在同一个开发服务器上频繁地在 CF8 和 CF10 之间切换,所以我一直在处理一批文件运行 wsconfig 以节省一些精力,我遇到了同样的问题。 CF 工作正常,但从不处理 / 的 index.cfm - 如上所述,所有映射似乎都设置正确。

    我发现如果您将每个站点都添加我的名字而不是使用“-site 0”,wsconfig 会更可靠地工作

    因此,例如,手动删除并重新安装在 IIS 上运行的两个站点的连接器

    set CFUSION_HOME=C:\ColdFusion10\cfusion
    %CFUSION_HOME%\runtime\bin\wsconfig -uninstall 
    net start "ColdFusion 10 Application Server"
    %CFUSION_HOME%\runtime\bin\wsconfig -ws IIS -site "Default Web Site"
    %CFUSION_HOME%\runtime\bin\wsconfig -ws IIS -site "My Website Name"
    

    【讨论】:

      【解决方案4】:

      我在将 CF 从 2016 升级到 2018 / 2021 后遇到了同样的问题。解决方案是:打开 IIS 管理器并转到 Handler Mappings。在这里,搜索 cfcHandler、cfmHandler、cfmlHandler 条目并右键单击,编辑它们,您可能会看到如下内容:C:\ColdFusion2021\config\wsconfig\1\isapi_redirect.dll

      确保路径已更新为 ColdFusion 服务器的当前版本。就我而言,即使我更新到 2021,它仍在尝试访问 ColdFusion2016 文件夹。

      这解决了我的问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-04-22
        • 2020-07-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-12-28
        • 2021-04-27
        相关资源
        最近更新 更多