Forum: Ruby on Rails Multiple Rails apps with SCGI?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
cool_screen_name90001 (Guest)
on 2005-12-10 23:02
(Received via mailing list)
I have two different Rails directories and I'm trying to get scgi to
serve both of them. There
don't appear to be any docs on how to do this. I thought perhaps it was
cluster, but that appears
to be just for concurrent connections in the same Rails directory. As it
is now, I can get my
first Rails directory to work, but the second just displays 'bad
gateway' errors. I've started
scgi in both Rails directories. I guess the missing link is in Lighty's
config, but I don't know
how to make requests for specific hosts go to specific scgi servers. My
lighty config:

scgi.server = ( "dispatch.scgi" => ((
  "host" => "127.0.0.1",
  "port" => 9999,
  "check-local" => "disable",
  "disable-time"=>0
)) )

I also played around with clusters:

scgi.server = (
  "dispatch.scgi" => (
    "server1" => (
      "host" => "127.0.0.1",
      "port" => 9999,
      "check-local" => "disable",
      "disable-time" => 0
    ),
    "server2" => (
      "host" => "127.0.0.1",
      "port" => 10000,
      "check-local" => "disable",
      "disable-time" => 0
    ),
    "server3" => (
      "host" => "127.0.0.1",
      "port" => 10001,
      "check-local" => "disable",
      "disable-time" => 0
    ),
    "server4" => (
      "host" => "127.0.0.1",
      "port" => 10100,
      "check-local" => "disable",
      "disable-time" => 0
    )
  )
)

I set scgi in the second Rails directory to use port 10100. But I still
get 'bad gateway' errors.
I've tried everything I can think of and still can't get it to work. Has
anybody been able to get
scgi to serve different Rails directories?

thanks for any help,
csn

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
JanPrill (Guest)
on 2005-12-10 23:31
(Received via mailing list)
Hi, CSN,

don't know how to do it with lighty, but I'm running multiple scgi apps
as VirtualHosts on Apache. Therefore I'm starting scgi_ctrl start with
different ports on the different directorys and define the SCGI-Mounts
in VirtualHost-directives that serve these directories. Maybe this is an
option for you.

regards
Jan
ezra (Guest)
on 2005-12-11 00:12
(Received via mailing list)
You need to make vhosts in lighttpd.conf for each rails app. So make
one of these sections for each rails app with a different domain
name.  Here is a sample. vhost:

$HTTP["host"] =~ "(www\.)?example\.com" {
   server.document-root     = "/home/username/railsapp/public/"
   server.error-handler-404 = "/dispatch.scgi"
   server.indexfiles          = ( "index.php", "index.html",
                                  "index.htm", "default.htm" )
   scgi.debug=0
   scgi.server = ( "dispatch.scgi" => ((
   "host" => "127.0.0.1",
   "port" => 9999,
   "check-local" => "disable",
   "disable-time"=>0
)) )

}

Cheers-
-Ezra

On Dec 10, 2005, at 1:00 PM, CSN wrote:

> how to make requests for specific hosts go to specific scgi
>
>       "port" => 10000,
>       "host" => "127.0.0.1",
> work. Has anybody been able to get
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

-Ezra Z.
WebMaster
Yakima Herald-Republic Newspaper
removed_email_address@domain.invalid
509-577-7732
cool_screen_name90001 (Guest)
on 2005-12-11 01:21
(Received via mailing list)
Aaahh... that was the missing link. Thanks!

I was curious to see if I could put scgi's config params in just one
vhost, and hopefully the
global scgi params would be the default for all other vhosts that didn't
have scgi config stuff.
Doesn't appear to work - the vhost with scgi params worked, but the
others displayed 404 errors.

csn


--- Ezra Z. <removed_email_address@domain.invalid> wrote:

>    scgi.server = ( "dispatch.scgi" => ((
>
> > scgi in both Rails directories. I guess the missing link is in
> >
> >     "server2" => (
> >     ),
> > still get 'bad gateway' errors.
> > http://mail.yahoo.com
> 509-577-7732
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
ezra (Guest)
on 2005-12-11 01:21
(Received via mailing list)
On Dec 10, 2005, at 2:59 PM, CSN wrote:

> csn
>

CSN-

	Take a look at mod_simple_vhost. with that you can have a fall back
rails app for when nothing else matches.

Cheers-
-Ezra

>>    server.indexfiles          = ( "index.php", "index.html",
>>
>>> As it is now, I can get my
>>>   "check-local" => "disable",
>>>       "check-local" => "disable",
>>>       "port" => 10001,
>>> )
>>> __________________________________________________
>> WebMaster
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

-Ezra Z.
WebMaster
Yakima Herald-Republic Newspaper
removed_email_address@domain.invalid
509-577-7732
List R. (Guest)
on 2005-12-11 05:58
Also, you can use different local IP's, keeping the ports the same.  Try
127.0.0.2, 127.0.0.3, etc.
This topic is locked and can not be replied to.