Configuring Multiple Rails Application with Lighttpd

June 28, 2006 at 10:06 pm Leave a comment

I was using lighttpd web server for my Rails applications.
In development mode I was starting lighttpd server from the rails application directory by

lighttpd -D -f config/lighttpd.conf
But I was facing problem when I tried to run multiple rails applications in production mode. After some trials I succeded.

I inserted the following lines of code in my /etc/lighttpd/lighttpd.conf file

$HTTP[“host”]== “domain.com” {

server.error-handler-404 = “/dispatch.fcgi”

server.document-root = “/home/railsapp/public/”

server.errorlog = “/home/railsapp/log/lighttpd.error.log”

accesslog.filename = “/home/railsapp/log/lighttpd.access.log”

url.rewrite = ( “^/$” => “index.html”, “^([^.]+)$” => “$1.html” )

fastcgi.server = ( “.fcgi” => ( “localhost” => (

“min-procs” => 1,

“max-procs” => 1,

“socket” => “/home/railsapp/tmp/sockets/fcgi.socket”,

“bin-path” => “/home/railsapp/public/dispatch.fcgi”,

“bin-environment” => ( “RAILS_ENV” => “production” )

) ) )

}

$HTTP[“host”]== “another.domain.com” {

server.error-handler-404=”/dispatch.fcgi”

server.document-root = “/home/anotherrailsapp/sparitual/public/”

server.errorlog = “/home/anotherrailsapp/log/lighttpd.error.log”

accesslog.filename = “/home/anotherrailsapp/log/lighttpd.access.log”

url.rewrite = ( “^/$” => “index.html”, “^([^.]+)$” => “$1.html” )

compress.filetype = ( “text/plain”, “text/html”, “text/css”, “text/javascript” )

compress.cache-dir = “/home/anotherrailsapp/tmp/cache”

fastcgi.server = ( “.fcgi” => ( “localhost” => (

“min-procs” => 1,

“max-procs” => 1,

“socket” => “/home/anotherrailsapp/tmp/sockets/fcgi.socket”,

“bin-path” => “/home/anotherrailsapp/public/dispatch.fcgi”,

“bin-environment” => ( “RAILS_ENV” => “production” )

) ) )

}

Then started the lighttpd server by

lighttpd -D -f /etc/lighttpd/lighttpd.conf

And it worked…

Entry filed under: rails. Tags: .

Cartographer: A Google maps API in Rails 19 Rails Tricks Most Rails Coders Don’t Know

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Important Notice…

I have moved this blog to http://webonrails.com . I will continue posting at http://webonrails.com, not on https://webonrails.wordpress.com.

Kindly update your book marks to http://webonrails.com

and http://webonrails.com/feed .

I am really very sorry for inconvenience.

Comming Soon….

Domain for Sale

TheRailsHosting.com


(Contact me)

Recent Posts

Calender

June 2006
M T W T F S S
« Apr   Jul »
 1234
567891011
12131415161718
19202122232425
2627282930  

Subscribe

  • Add to Google
  • Subscribe in NewsGator Online
  • Subscribe with Bloglines
  • WebOnRails on feedburner
  • technorati

del.icio.us

Feeds

Flickr Photos

A bellezza di a natura (C☺rsica)

JWL5932 Mountain Hare..

Black and Gold

More Photos

Visitor’s Location

Blog Stats

  • 17,978 hits

%d bloggers like this: