[Mongrel] setting enviroment variable

Luis Lavena luislavena at gmail.com
Tue Feb 6 06:54:13 EST 2007

On 2/6/07, ufuk kocolu <ufuk at pilli.com> wrote:
> I have a ror project which has been productized. There are several web
> sites in one ror project


A) You are serving multiple sites from one rails application?


B) You have multiple instances of your rails application, each one
serving a specific web site.

> I need to set an "enviroment variable" to run different sites, can I do
> that using mongrel? I tried to use mongrel's -S option and set the
> enviroment variable in that file but it seems mongrel runs that file
> after it calls enviroment.rb

The answers will be:

A) Use something like subdomain accounts:

B) process your ENV information inside environment, and set your
environment variable prior calling mongrel_rails:

  $ MY_SITE=site1 mongrel_rails start ...


  $ export MY_SITE=site1
  $ mongrel_rails start ...

Luis Lavena
Multimedia systems
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi

More information about the Mongrel-users mailing list