# How to setup Lighttpd on Windows?

**URL:** <https://www.ruby-forum.com/t/how-to-setup-lighttpd-on-windows/118591>\
**Category:** Rails\
**Created:** [October 29, 2007, 9:18am UTC](https://www.ruby-forum.com/t/how-to-setup-lighttpd-on-windows/118591 "2007-10-29T09:18:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vapor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5e9695/32.png) [@vapor](https://www.ruby-forum.com/u/vapor)\
**Post date:** [October 29, 2007, 9:18am UTC](https://www.ruby-forum.com/t/how-to-setup-lighttpd-on-windows/118591/1 "2007-10-29T09:18:46Z")

</div>

I have downloaded Lighttpd for Windows from  
[http://wlmp.dtech.hu/down\_lighty.php?lang=en](http://wlmp.dtech.hu/down_lighty.php?lang=en)

But I dont really know how to setup to run Rails apps.

---

<div class="post-metadata">

**Author:** ![vapor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5e9695/32.png) [@vapor](https://www.ruby-forum.com/u/vapor)\
**Post date:** [October 29, 2007, 10:02am UTC](https://www.ruby-forum.com/t/how-to-setup-lighttpd-on-windows/118591/2 "2007-10-29T10:02:07Z")

</div>

Hi Vapor

The recommended approach for Windows is Apache 2.2 x + a pack of  
mongrels…

HTH

CCH

> **[Rails... Rails... Rails](http://cch4rails.blogspot.com)**
>
> Chee Chong Hwa aka CCH, a Malaysian Chief Software Architect blogs on his experiences with Ruby on Rail running on Win2003 Server+Apache 2.26 environment since 2007. Flirted briefly with Ubuntu 9.04 in 2009. Since January 2017, now using RubyMine...

On Oct 29, 4:18 pm, “Vapor …” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![vapor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5e9695/32.png) [@vapor](https://www.ruby-forum.com/u/vapor)\
**Post date:** [November 15, 2007, 8:38am UTC](https://www.ruby-forum.com/t/how-to-setup-lighttpd-on-windows/118591/3 "2007-11-15T08:38:17Z")

</div>

In case you’re still interested:

I assume you have already, but if not

1. install ruby: [Download Ruby](http://www.ruby-lang.org/en/downloads)
2. install rails: gem install rails --include-dependencies

now

1. download this and install it  
[http://www.zedshaw.com/downloads/scgi\_rails/scgi\_rails-0.4.3.gem](http://www.zedshaw.com/downloads/scgi_rails/scgi_rails-0.4.3.gem)

gem install scgi\_rails-0.4.3.gem

say yes if it asks if you want to install dependencies

1. install lighttpd

2. 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 = (  
“mod\_rewrite”,  
“mod\_redirect”,  
“mod\_access”,  
“mod\_accesslog”,  
“mod\_status”,  
“mod\_scgi”)  
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” =\> “127.0.0.1”,  
“port” =\> 9999,  
“check-local” =\> “disable”  
)) )  
scgi.debug=0  
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” =\> “127.0.0.1”,  
“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.

1. now, from your rail app root folder, run lighttpd

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

1. one more thing: you need to run the scgi service

scgi\_service

now you should be abe to access your app

[http://localhost:3000/myapp](http://localhost:3000/myapp)

---

<div class="post-metadata">

**Author:** ![vapor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5e9695/32.png) [@vapor](https://www.ruby-forum.com/u/vapor)\
**Post date:** [November 15, 2007, 3:31pm UTC](https://www.ruby-forum.com/t/how-to-setup-lighttpd-on-windows/118591/4 "2007-11-15T15:31:44Z")

</div>

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…  
scgi\_service

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