首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Apache运行Rails Mongrel

使用Apache运行Rails Mongrel
EN

Stack Overflow用户
提问于 2012-08-04 13:02:42
回答 2查看 899关注 0票数 4

我正在尝试部署我的小型rails应用程序。我的VPS正在运行Apache2.2,我希望将请求定向到一个mongrel集群来处理我的新rails应用程序。

RubyVersion1.9.3 Rails版本3.2.7 Mongrel版本1.2.0 (gem安装mongrel -pre)

我做了什么,

我已经为端口3001到3003启动了3个mongrel守护进程,如下所示:

代码语言:javascript
复制
mongrel_rails start -e production -p 3001 -d -P log/mongrel1.pid

分别使用。

运行每个start命令后要注意的事项;我得到以下通知:

注意:不推荐使用Gem::SourceIndex.from_installed_gems,不需要替换。它将在2011至10-01年间或之后被移除。从/usr/local/rvm/gems/ruby-1.9.3-p194/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:109.调用的Gem::SourceIndex.from_installed_gems注: from_installed_gems(arg)被废弃。从/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb:63:in‘块(2层)中弃用“注意: Gem::SourceIndex.from_gems_in被弃用而不替换。它将在2011至10-01年间或之后被移除。从/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:50.调用的Gem::SourceIndex.from_gems_in注意:不推荐使用Gem::SourceIndex#each,不需要替换。它将在2011-11-01年或之后被移除。从/usr/local/rvm/gems/ruby-1.9.3-p194/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:112.调用的Gem::SourceIndex#each

我的理解告诉我这不应该是个问题,但是当我跑的时候:

代码语言:javascript
复制
ps aux | grep mongrel

我得到:

代码语言:javascript
复制
someotheruser     17186  0.0  0.1 101064  1336 pts/0    S    12:56   0:00 su mongrel
mongrel  17187  0.1  0.3  67260  2872 pts/0    S    12:56   0:00 bash
mongrel  17284  0.0  0.1  65600   980 pts/0    R+   12:56   0:00 ps aux
mongrel  17285  0.0  0.0  61176   728 pts/0    R+   12:56   0:00 grep mongrel

也就是说,我找不到服务器进程。

我更新了我的虚拟主机如下:

代码语言:javascript
复制
<proxy balancer://mongrelcluster>
  BalancerMember http://127.0.0.1:3001
  BalancerMember http://127.0.0.1:3002
  BalancerMember http://127.0.0.1:3003
</proxy>

<VirtualHost *:80>
  ServerName subdomain.mydomain.co.uk
  ServerAlias subdomain.mydomain.co.uk
  ProxyPass / balancer://mongrelcluster/
  ProxyPassReverse / balancer://mongrelcluster/
  ProxyPreserveHost on
</VirtualHost>

当我将浏览器指向subdomain.mydomain.co.uk时,会遇到一个Apache403错误,但我不知道错误在哪里。很可能是杂种狗没有按它应有的方式运行,但也许我设置的vhost不正确。

感谢您的帮助和/或指导,谢谢!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-08-07 17:15:38

检查了Mongrel日志文件,问题似乎是我的database.yml文件将适配器指定为sqlite3,而它本应是mysql2。我没有安装sqlite3,所以Mongrel不会启动。

票数 1
EN

Stack Overflow用户

发布于 2012-08-06 14:07:23

我认为您可能在DocumentRoot标记中缺少了一个VirtualHost规范。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11808893

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档