How to setup Lighttpd on Windows?

In case you're still interested:

I assume you have already, but if not
1) install ruby:
2) install rails: gem install rails --include-dependencies


3) download this and install it

gem install scgi_rails-0.4.3.gem

say yes if it asks if you want to install dependencies

4) install lighttpd

5) copy c:\lighttpd\etc\lighttpd.conf to your rails app's config
folder. edit the config file as shown below. Replace c:/railapps
with path to your rail application, e.g., c:/rorapps/myapp. I'm only
showing the parts you need to change.

server.modules = (
server.document-root = "C:/RailsApp/public"
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" )
server.error-handler-404 = "/dispatch.scgi"
scgi.server = ( "dispatch.scgi" => ((
  "host" => "",
  "port" => 9999,
  "check-local" => "disable"
)) )
status.status-url = "/server-status"
status.config-url = "/server-config"
server.port = 3000 # or whatever you like

what this part

server.error-handler-404 = "/dispatch.scgi"
scgi.server = ( "dispatch.scgi" => ((
  "host" => "",
  "port" => 9999,
  "check-local" => "disable"
)) )

does is tell the lighttpd server to handle 404 file not found error by
handing it off to the scgi service which will serve your rail app.

6) now, from your rail app root folder, run lighttpd

c:\lighttpd\sbin\lighttpd.exe -f config/lighttpd.conf

7) one more thing: you need to run the scgi service


now you should be abe to access your app


Vapor .. wrote:

sorry I skipped a step

5.5) execute this from commandline in your rail app's folder

scgi_ctrl config -S

this creates the necessary scgi.yaml file in your config folder.

You can then create a batch file like this

@echo off
echo Stopping lighty...
c:\lighttpd\sbin\process.exe -k lighttpd.exe
echo Starting lighty...
c:\lighttpd\sbin\lighttpd.exe -f config\lighttpd.conf
echo Stopping SCGI_service...
c:\lighttpd\sbin\process.exe -k ruby.exe
echo Starting SCGI_service...

in your rail app's folder and execute it to get the whole thing going.