我正在尝试部署我的小型rails应用程序。我的VPS正在运行Apache2.2,我希望将请求定向到一个mongrel集群来处理我的新rails应用程序。
RubyVersion1.9.3 Rails版本3.2.7 Mongrel版本1.2.0 (gem安装mongrel -pre)
我做了什么,
我已经为端口3001到3003启动了3个mongrel守护进程,如下所示:
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
我的理解告诉我这不应该是个问题,但是当我跑的时候:
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时,会遇到一个Apache403错误,但我不知道错误在哪里。很可能是杂种狗没有按它应有的方式运行,但也许我设置的vhost不正确。
感谢您的帮助和/或指导,谢谢!
发布于 2012-08-07 17:15:38
检查了Mongrel日志文件,问题似乎是我的database.yml文件将适配器指定为sqlite3,而它本应是mysql2。我没有安装sqlite3,所以Mongrel不会启动。
发布于 2012-08-06 14:07:23
我认为您可能在DocumentRoot标记中缺少了一个VirtualHost规范。
https://stackoverflow.com/questions/11808893
复制相似问题