How to use Mongrel instead of WEBrick?

Added by Patrick Gibson over 9 years ago

I've installed Redmine 0.7 on a FreeBSD 6.2 server, and I'm having a really hard time keeping things running continuously. With WEBrick, it runs okay for a while, and then just stops answering requests. The ruby process needs a kill -9 and a restart to get it going again. I've now switched to FastCGI under Apache, but it also craps out:

[03/Jun/2008:16:37:55 :: 63987] Dispatcher failed to catch: bad content body (EOFError)
/usr/local/lib/ruby/1.8/cgi.rb:1022:in `read_multipart'
/usr/local/lib/ruby/1.8/cgi.rb:985:in `loop'
/usr/local/lib/ruby/1.8/cgi.rb:985:in `read_multipart'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_ext/raw_post_data_fix.rb:38:in `initialize_query'
/usr/local/lib/ruby/1.8/cgi.rb:2273:in `initialize'
(eval):16:in `initialize'
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:612:in `new'
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:612:in `each_cgi'
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:609:in `each'
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:609:in `each_cgi'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/fcgi_handler.rb:141:in `process_each_request!'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/fcgi_handler.rb:55:in `process!'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/fcgi_handler.rb:25:in `process!'
/usr/home/coverall/redmine-0.7/public/dispatch.fcgi:45
almost killed by this error

I'd like to give Mongrel a try, but as I'm a newbie to Rails stuff, it's not clear to me how to load the Rails app using Mongrel instead of WEBrick. Has anyone tried doing this?

Thanks,

Patrick

Replies (3)

RE: How to use Mongrel instead of WEBrick? - Added by Patrick Gibson over 9 years ago

At first I suspected it might have been some sort of sqlite3 problem, so I switched everything over to MySQL (not an easy process once there's data in there!). Things seem fine under MySQL, so at least I can eliminate the database as the cause of my ongoing problems...

RE: RE: How to use Mongrel instead of WEBrick? - Added by Mat Schaffer over 9 years ago

I've heard bad things about fcgi. Apache mod_proxybalancer + mongrel seems to be the favorite. Or mod_rails if you're feeling adventurous. As for mongrel-vs-webrick. Just do gem install mongrel. Rails should autodetect mongrel and use that instead.

For more details on apache + mongrel setup, see this discussion:
http://www.redmine.org/boards/2/topics/show/1019

RE: RE: RE: How to use Mongrel instead of WEBrick? - Added by Thomas Lecavelier over 9 years ago

The short answer for using mongrel is just to install it:

# gem install mongrel

(1-3/3)