1

我在 Tomcat 6.0.32 中运行 Railo 3。tomcat 服务器以 Apache 2.2.20 为前端。Tomcat 和 Apache 是来自 openCSW 的预构建二进制文件。Railo 只是部署在 tomcat 的 autodeploy dir webapps 中的最新构建战。

当我尝试访问 Tomcat 服务器上的 railo 和内容时,一切正常。

但是,当 tomcat 上的 railo 将我重定向到它自己时,它失败了。大多数情况下,当 cfm 脚本使用 CGI.script_name时,它​​会返回错误。

在 Apache 方面,内容可在 www.hostname.com 上获得。Apache 通过 www.hostname.com:8009/railo/content 上的 AJP 将用户重定向到 tomcat。

tomcat 上的脚本(取自 open OAuth 示例)可在以下位置获得:

/opt/csw/share/tomcat6/webapps/railo/content/oauth_test/examples/admin_consumers.cfm

当我访问它并尝试执行某些操作时,它会使用一些参数调用自身,但此时,railo 转储出一个错误,抱怨找不到该文件:

Page /content/railo/content/oauth_test/examples/admin_consumers.cfm [/opt/csw/share/tomcat6/webapps/railo/content/railo/content/oauth_test/examples/admin_consumers.cfm] not found

如您所见,railo 添加了两次来自 tomcat 的相对路径:/railo/content/railo/content

这是我在 Apache 中对虚拟主机的配置:

<VirtualHost *:443>
    ServerName www.hostname.com
    DocumentRoot "/opt/www/hostname/htdocs/"

    ProxyRequests Off
    <proxy *="">
        Order deny,allow
        Allow from all
    </proxy>

    ProxyPass / ajp://www.hostname.com:8009/railo/content/
    ProxyPassReverse / http://www.hostname.com:8888/railo/content/
</VirtualHost>

我为 ProxyPassReverse 指令尝试了几种变体,但到目前为止没有运气。基于网络上的广泛搜索(ProxyPassReverse 之谜),我为 proxypassreverse 尝试了这个:

    ProxyPassReverse / ajp://www.hostname.com:8009/railo/content/
    ProxyPassReverse / http://www.hostname.com:8888/railo/content/
    ProxyPassReverse / http://localhost:8888/railo/content/
    ProxyPassReverse / https://www.hostname.com

tomcat 服务器也有一个虚拟主机,定义如下:

 <Host name="www.hostname.com">
    <Context path="" docBase="/opt/csw/share/tomcat6/webapps/railo/content" />
 </Host>

但每次,我总是从 Railo 那里得到错误。

有没有人见过 Railo 或 CGI 的这个问题,并且知道如何解决它?

4

1 回答 1

0

You are specifying "/railo/content" twice. Once in your "docBase" attribute and again in your Proxy attributes. So, requests being proxied through Apache are going to have "railo/content/" twice in their request paths because you have it listed twice: once in Apache, another time in Tomcat.

Try leaving off the /railo/content/ in your ProxyPassReverse attribute:

ProxyPassReverse / http://www.hostname.com:8888/

This will let the Tomcat config add the /railo/content/ bit all by itself.

于 2012-01-27T18:57:17.997 回答