Jeremy Hinegardner
2005-May-04 03:31 UTC
multiple rails apps in a lighttpd vhost environment
Hi all, I have one lighttpd server running about 30 domains via mod_simple_vhost and now I want to add multiple rails apps to one of the domains. I''ve done some trial and error experimenting and the following config is what seems to be working for me. Is this the best way to do it? It seems before too long that the configuration is going to get out of hand. In the ''server.document-root'' directory ''ls -n'' shows: lrwx------ 1 1000 67 18 May 2 22:11 hieraki -> ../hieraki/public/ -rw-r--r-- 1 1000 67 201 May 2 21:23 index.html lrwx------ 1 1000 67 15 May 2 22:06 typo -> ../typo/public/ The relevant portions of my lighttpd.conf file are: $HTTP["host"] == "demo.example.com" { server.document-root = "/var/www/vhosts/demo.example.com/htdocs/" server.indexfiles = ("dispatch.fcgi","index.html") $HTTP["url"] =~ "typo" { server.error-handler-404 = "/typo/dispatch.fcgi" fastcgi.server = (".fcgi" => ("typo" => ( "socket" => "/tmp/typo-1.socket", "bin-path" => "/var/www/vhosts/demo.example.com/typo/public/dispatch.fcgi", "bin-environment" => ("RAILS_ENV"=> "production") ) ) ) } $HTTP["url"] =~ "hieraki" { server.error-handler-404 = "/hieraki/dispatch.fcgi" fastcgi.server = (".fcgi" => ("hieraki" => ( "socket" => "/tmp/hieraki-1.socket", "bin-path" => "/var/www/vhosts/demo.example.com/hieraki/public/dispatch.fcgi", "bin-environment" => ("RAILS_ENV"=> "production") ) ) ) } } $HTTP["host"] != "demo.example.com" { simple-vhost.server-root = "/var/www/vhosts/" simple-vhost.default-host = "www.example.com" simple-vhost.document-root = "/htdocs/" } Comments, improvements, ideas, etc are welcome. In general I''m looking for solutions in which multiple domains can each have multiple rails apps underneath them using lighttpd. Whatever the results I''ll put up a wiki page on the configuration so others can learn too. enjoy, -jeremy -- ======================================================================= Jeremy Hinegardner jeremy-eg9WJcVQRd1EMKyauTCisw@public.gmane.org