mod_proxy 返回带有乘客的 Rails 3.1 应用程序的空白页面

发布于 2024-12-13 10:18:06 字数 1783 浏览 0 评论 0原文

这让我抓狂,我几天来一直在尝试让它运行,所以也许我有点关注错误的主题,但这是我的调查结果:

  1. 我有一个 apache2+passenger 运行服务器应用程序(php + Rails)
  2. 我已经安装了rvm来使用不同的gemsets并且(主要原因)根据应用程序使用ruby 1.8.7和ruby 1.9.2 -->这很完美!

好吧,现在我想显示这些应用程序,我发现我必须以不同的方式设置乘客。好消息:旧应用程序可以工作(1.8.7),新应用程序(1.9.2)则不能。所以我做了...

  1. 安装 mod_proxy 将请求路由到在 127.0.0.1:3000 上运行的乘客服务器 -->还有个好消息:这有效

,但是......

甚至 Rails 应用程序的日志文件显示,应用程序在每个请求上都呈现没有任何错误,页面仅显示文档类型。

更奇怪的是:当我的 Gemfile 上出现配置错误时,会显示正确的乘客错误。

所以我有点卡在这里。

我的 mod 代理配置非常基本:

    <IfModule mod_proxy.c>
    #turning ProxyRequests on and allowing proxying from all may allow
    #spammers to use your proxy to send email.

    ProxyRequests Off
    <Proxy *>
            AddDefaultCharset off
            Order deny,allow
            Allow from all
            Allow from 127.0.0.1
    </Proxy>

    # Enable/disable the handling of HTTP/1.1 "Via:" headers.
    # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
    # Set to one of: Off | On | Full | Block

    ProxyVia On
    </IfModule>

虚拟主机:

    <VirtualHost *:80>
    ServerName myapp.host.com
    DocumentRoot /var/www/myapp/public

    PassengerEnabled off
    ProxyPass / http://127.0.0.1:3000/
    ProxyPassReverse / http://127.0.0.1:3000/
    ProxyPreserveHost on
    <Directory /var/www/myapp>
            Options FollowSymLinks
            AllowOverride All
            Order Deny,Allow
            Allow from all
    </Directory>

    </VirtualHost>

如果您需要任何进一步的信息来帮助我解决此问题,请告诉我!

谢谢您的任何提示:/

/编辑/ funfact:标头正在提供“服务器:nginx/1.0.6 + Phusion Passenger 3.0.9 (mod_rails/mod_rack)”,尽管该服务器上没有安装 nginx ...

this is driving me nuts and I'm trying to get this running since days so maybe I'm a little bit focused on the wrong topic but here are the results of my investigations:

  1. I have an apache2+passenger running with sever applications (php + rails)
  2. I've installed rvm to use different gemsets and (main reason) to use ruby 1.8.7 and ruby 1.9.2 depending on the application --> this works perfect!

okay, now I wanted to display those applications and I found out, that I have to setup passenger in a different way. good news: old applications work (1.8.7) new application (1.9.2) does not. so I did...

  1. install mod_proxy to route request to an passenger server running on 127.0.0.1:3000 --> also good news: this works

BUT....

even the logfiles of the rails application shows, that the applications is rendered without any errors on every request, the page only displays a doctype.

more strange: when I had an configuration error on my Gemfile, the correct passenger error was show.

So I'm a little bit stuck here.

my mod proxy configuration is pretty basic:

    <IfModule mod_proxy.c>
    #turning ProxyRequests on and allowing proxying from all may allow
    #spammers to use your proxy to send email.

    ProxyRequests Off
    <Proxy *>
            AddDefaultCharset off
            Order deny,allow
            Allow from all
            Allow from 127.0.0.1
    </Proxy>

    # Enable/disable the handling of HTTP/1.1 "Via:" headers.
    # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
    # Set to one of: Off | On | Full | Block

    ProxyVia On
    </IfModule>

virtual host:

    <VirtualHost *:80>
    ServerName myapp.host.com
    DocumentRoot /var/www/myapp/public

    PassengerEnabled off
    ProxyPass / http://127.0.0.1:3000/
    ProxyPassReverse / http://127.0.0.1:3000/
    ProxyPreserveHost on
    <Directory /var/www/myapp>
            Options FollowSymLinks
            AllowOverride All
            Order Deny,Allow
            Allow from all
    </Directory>

    </VirtualHost>

if you need any further information to help me resolving this issue please let me know!

thank you for ANY hint :/

/edit/
funfact: header is serving "Server:nginx/1.0.6 + Phusion Passenger 3.0.9 (mod_rails/mod_rack)" although no nginx is installed on this server...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文