Hi,
I''m trying to get Rails and Duane Johnson''s ProductGenerator
working
together with lighttpd. I''m trying to configure 2 subdomains :
--> golf.mydomain.com
and
--> school.mydomain.com
where "golf" and "school" are 2 second-tiers sites built on
the same
generic rails app.
I setup 2 vhosts in my lighttpd.conf as follows ($RAILS_ROOT is
/data/www/mike/online/):
$HTTP["host"] == "school.mydomain.com" {
server.document-root = "/data/www/mike/online/public"
setenv.add-environment = ( "APP_USER" => "mike")
fastcgi.server = (".fcgi" =>
( "rails" => (
"socket" =>
"/tmp/ruby-fastcgi-mike.socket",
"bin-path" =>
"/data/www/mike/online/sites/school/public/dispatch.fcgi",
"bin-environment" => ("site" =>
"school")
)
)
)
alias.url = ("/generic" =>
"/data/www/mike/online/public")
}
$HTTP["host"] == "golf.mydomain.com" {
server.document-root = "/data/www/mike/online/public"
setenv.add-environment = ( "APP_USER" => "mike")
fastcgi.server = (".fcgi" =>
( "rails" => (
"socket" =>
"/tmp/ruby-fastcgi-mike.socket",
"bin-path" =>
"/data/www/mike/online/sites/golf/public/dispatch.fcgi",
"bin-environment" => ("site" =>
"golf")
)
)
)
alias.url = ("/generic" =>
"/data/www/mike/online/public")
}
My problem is lighttpd will only serve one of the vhosts, no matters
which is the actual host. Actually, both "golf.mydomain.com" and
"school.mydomain.com" lead to the same vhost, which is the first one
declared in lighttpd.conf, i.e in the above example, both adresses will
serve the "school" site but if I switch declaration blocks both
adresses
will serve the "golf" site.
Did anyone face the same problem ?
How did you resolve it ?
Thanks
--
Michael Baudino
EPITA 2007
KameHouse Prod.