Project

General

Profile

How to keep webrick running after existing console

Added by David B about 14 years ago

Totally new to ruby, rails and redmine. I have managed to setup redmine. But I hate having to keep a console open to keep webrick running. How can I get webrick running in background so I don't need to be in a console to do it?

Cheers!


Replies (8)

RE: How to keep webrick running after existing console - Added by Felix Schäfer about 14 years ago

Not knowing what operating system you're on, I'll give you some general advice on setting this up:
  1. ditch webrick, it's fine for test and development, but there are far better alternatives in terms of speed and resource usage.
  2. depending on what you already have, I'd recommend phusion passenger (aka mod_rails) if you already have nginx or apache configured on the machine (OS X ships with apache out of the box, and there is a prefpane for passenger making installation quite easy), or thin or mongrel if not.
  3. have a look at some documentation of your distribution to set any of this up, I might be able to help with OS X, gentoo and maybe ubuntu, but the OS forums/guides are most of the time the best source for this sort of stuff :-)

RE: How to keep webrick running after existing console - Added by David B about 14 years ago

cheers, i have decided to go for apache as I already have it installed (linux centos5). I have followed the instructions on http://www.redmine.org/wiki/redmine/HowTo_configure_Apache_to_run_Redmine, but for some reason im getting a 500 error.

dispatch:


#!/usr/lib/ruby

require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)

# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/dispatcher" -- otherwise performance is severely impaired
require "/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/dispatcher.rb" 

ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
Dispatcher.dispatch

apache errors:

[Fri Jan 08 12:48:00 2010] [error] [client 172.20.37.11] (13)Permission denied: exec of '/opt/redmine-0.8.7/public/dispatch.cgi' failed
[Fri Jan 08 12:48:00 2010] [error] [client 172.20.37.11] Premature end of script headers: dispatch.cgi

RE: How to keep webrick running after existing console - Added by David B about 14 years ago

dispatch is 755 owner: apache group: apache

RE: How to keep webrick running after existing console - Added by Felix Schäfer about 14 years ago

Well, I have no experience whatsoever with cgi or fcgi, so I won't be able to help you with that, and I'd recommend starting a new thread regarding that problem if you want to use fcgi.

If you have apache, I'd strongly recommend passenger though, it was pretty easy to install on the three aforementioned platforms (no reason it shouldn't be on centOS ;-) ), and I hear it behaves nicer than cgi/fcgi. Just grab a tutorial to install passenger on centOS, and you should be good to go, the only caveat I faced was the .htaccess file in the $REDMINE/public directory, which seems to clash in some way with a passenger setup, but afaik it's safe to delete.

RE: How to keep webrick running after existing console - Added by David B about 14 years ago

Wow, nice one. Found the following article that walked me through it completly!!! Cheers! Now I can start using redmine as I intended to.

http://articles.slicehost.com/2009/4/7/centos-mod_rails-installation

RE: How to keep webrick running after existing console - Added by Felix Schäfer about 14 years ago

Glad it worked so quickly for you :-) Depending on the load your installation will be under, I'd also recommend a quick read of the passenger configuration options, but the defaults should be fine for the moment.

RE: How to keep webrick running after existing console - Added by David B about 14 years ago

Thanks for the heads up. We will have about 3 users, 10 projects adn about 300+ tasks in total.

RE: How to keep webrick running after existing console - Added by Jigar Vyas almost 12 years ago

Thanks, worked wonders for me!

David B wrote:

Wow, nice one. Found the following article that walked me through it completly!!! Cheers! Now I can start using redmine as I intended to.

http://articles.slicehost.com/2009/4/7/centos-mod_rails-installation

    (1-8/8)