mod_proxy 返回带有乘客的 Rails 3.1 应用程序的空白页面
这让我抓狂,我几天来一直在尝试让它运行,所以也许我有点关注错误的主题,但这是我的调查结果:
- 我有一个 apache2+passenger 运行服务器应用程序(php + Rails)
- 我已经安装了rvm来使用不同的gemsets并且(主要原因)根据应用程序使用ruby 1.8.7和ruby 1.9.2 -->这很完美!
好吧,现在我想显示这些应用程序,我发现我必须以不同的方式设置乘客。好消息:旧应用程序可以工作(1.8.7),新应用程序(1.9.2)则不能。所以我做了...
- 安装 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:
- I have an apache2+passenger running with sever applications (php + rails)
- 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...
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论