4

我正在尝试部署我的小型 Rails 应用程序。我的 VPS 正在运行 Apache 2.2,我希望将请求定向到混合集群以处理我的新 Rails 应用程序。

Ruby 版本 1.9.3 Rails 版本 3.2.7 Mongrel 版本 1.2.0 (gem install mongrel --pre)

我做了什么

我已经为端口 3001 到 3003 启动了 3 个 mongrel 守护进程,其中包括:

mongrel_rails start -e production -p 3001 -d -P log/mongrel1.pid

分别。

运行每个启动命令后需要注意的事项;我收到以下通知:

注意: Gem::SourceIndex.from_installed_gems 已被弃用,没有替代品。它将在 2011 年 10 月 1 日或之后删除。从 /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 `block (2 levels) in deprecate' 注意:Gem: :SourceIndex.from_gems_in 已被弃用,没有替代品。它将在 2011 年 10 月 1 日或之后删除。从 /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 或之后删除。宝石::

我的理解告诉我这应该不是问题,但是当我运行时:

ps aux | grep mongrel

我得到:

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

即,我找不到服务器进程。

我已将我的虚拟主机更新为:

<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 时,我收到一个 Apache 403 错误,但我不知道错误在哪里。mongrel 可能没有按应有的方式运行,但也许我的虚拟主机设置不正确。

感谢任何帮助和/或指导,谢谢!

4

2 回答 2

1

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

于 2012-08-07T17:15:38.070 回答
0

我想您可能在您的 VirtualHost 标记中缺少 DocumentRoot 规范。

于 2012-08-06T14:07:23.587 回答