<body>

Caiwangqin's blog

Focus on Web2.0, Business, Architecture, Agile, Technic and beyond…

Beta技术沙龙 Lighttpd & Modcache 交流会

2009年6月29日 星期一



Beta技术沙龙已经举行了五期,人气越来越旺了。

标签: , ,

posted by Caiwangqin, 上午11:39 | Permalink

multiple Rails sites running with lighttpd on the same domain

2006年7月26日 星期三

Well, it was a pain in the ass, but I managed to get multiple Rails sites running with lighttpd on the same domain.


Check it out! colloboa install 1 and colloboa install 2. They’re running off collaboa, which is a rails app.


Here’s the interesting parts of the lighttpd.conf file that makes this magic shit work:


# needed for aliases to work
server.modules = ( "mod_rewrite", "mod_fastcgi", "mod_alias" )

$HTTP["url"] =~ "^/svn_browser/cisv" {
server.document-root ="http://www.uuzone.com/users/home/joevd/domains/joevandyk.com/cisv_collaboa/public/"
alias.url = ( "/svn_browser/cisv" => "/users/home/joevd/domains/joevandyk.com/cisv_collaboa/public" )
server.error-handler-404 ="http://www.uuzone.com/svn_browser/cisv/dispatch.fcgi"
server.indexfiles = ( "dispatch.fcgi", "index.html" )

fastcgi.server = ( ".fcgi" =>
((
"socket" => "/home/joevd/lighttpd/joevd_cisv_svn1.socket",
"min-procs" => 1,
"max-procs" => 1,
"bin-path" => "/users/home/joevd/domains/joevandyk.com/cisv_collaboa/public/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => "production" )
)))
}

$HTTP["url"] =~ "^/svn_browser/gamefest" {
server.document-root ="http://www.uuzone.com/users/home/joevd/domains/joevandyk.com/gamefest_collaboa/public/"
alias.url = ( "/svn_browser/gamefest" => "/users/home/joevd/domains/joevandyk.com/gamefest_collaboa/public" )
server.error-handler-404 ="http://www.uuzone.com/svn_browser/gamefest/dispatch.fcgi"
server.indexfiles = ( "dispatch.fcgi", "index.html" )

fastcgi.server = ( ".fcgi" =>
((
"socket" => "/home/joevd/lighttpd/joevd_gamefest_svn1.socket",
"min-procs" => 1,
"max-procs" => 1,
"bin-path" => "/users/home/joevd/domains/joevandyk.com/gamefest_collaboa/public/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => "production" )
)))
}

You also need to add the following to the app’s config/environment.rb file (at the very end):


ActionController::AbstractRequest.relative_url_root ="http://www.uuzone.com/svn_browser/cisv"

It’s a royal pain, but it’s pretty cool once you got a working configuration.


more resource:


http://forum.textdrive.com/viewtopic.php?id=7147&p=1


http://pinkpucker.net/articles/2006/01/31/getting-multiple-rails-sites-going-on-one-domain-using-lighttpd


http://blog.lighttpd.net/articles/2005/11/23/lighttpd-1-4-8-and-multiple-rails-apps



标签: , ,

posted by Caiwangqin, 下午9:48 | Permalink