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
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 CSN wrote:>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 >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > > >
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:
> 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
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-Ezra Zygmuntowicz
WebMaster
Yakima Herald-Republic Newspaper
ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org
509-577-7732
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 Zygmuntowicz <ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org> wrote:> 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: > > > 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 > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > -Ezra Zygmuntowicz > WebMaster > Yakima Herald-Republic Newspaper > ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org > 509-577-7732 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > 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
On Dec 10, 2005, at 2:59 PM, CSN wrote:> > 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 >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> > --- Ezra Zygmuntowicz <ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org> wrote: > >> 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: >> >>> 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 >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >> >> -Ezra Zygmuntowicz >> WebMaster >> Yakima Herald-Republic Newspaper >> ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org >> 509-577-7732 >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> 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 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org 509-577-7732