Clueless !!!

A journal to keep track of my experimentation with different technologies

Archive for the ‘rails’ Category

Setting up Lighttpd + SCGI + Rails on a windows machine

with one comment

This assumes that you have installed rails on your machine. Also lot of the steps are based on what is present at RoR Wiki.

1. Download Lighttpd installer and install it. It will install at c:\lighttpd. You can start and stop lighttpd from the .bat files in the sbin directory. If starts on port 80 by default. You can find the config file under etc\lighttpd.conf

2. We need to install SCGI Rails Runner server. But before we do that install cmdparse ( 2.0.0 or greater ) and highline ( 1.0.1 or greater )

a) gem install cmdparse

b) gem install highline

c) Download the latest rails scgi gem and run gem install scgi_rails-0.4.3.gem.

3. Create your rails app ( Lets assume you created the “cookbook” app in e:\apps\railsapps\cookbook )

a) cd e:\apps\railsapps\cookbook

b) scgi_ctrl config -S ( please read up on the significance of -S option from the SCGI Rails Runner website)

c) scgi_service (scgi_ctrl doesn’t work on windows)

4) We need to now edit the configuration file for lighttp. Make the following changes

server.modules = (
“mod_rewrite”,
“mod_redirect”,
“mod_access”,
“mod_accesslog”,
“mod_status”,
“mod_scgi”)
server.document-root = “E:/apps/railsapps/cookbook/public”
server.errorlog = “e:/apps/railsapps/cookbook/log/lighttpd-errors.log”
server.errorlog = “e:/apps/railsapps/cookbook/log/lighttpd-access.log”
static-file.exclude-extensions = ( “.php”, “.pl”, “.fcgi”, “.scgi” )
server.error-handler-404 = “/dispatch.scgi”
scgi.server = ( “dispatch.scgi” => ((
“host” => “127.0.0.1″,
“port” => 9999,
“check-local” => “disable”
)) )

scgi.debug=0
status.status-url = “/server-status”
status.config-url = “/server-config”

5. Restart the lighttpd server and you are good to go.

Written by vidyanand

August 27, 2007 at 3:50 am

Posted in rails