# Config file for Lighttpd for win 2003 server

**URL:** <https://www.ruby-forum.com/t/config-file-for-lighttpd-for-win-2003-server/96672>\
**Category:** Ruby\
**Created:** [January 24, 2006, 5:34pm UTC](https://www.ruby-forum.com/t/config-file-for-lighttpd-for-win-2003-server/96672 "2006-01-24T17:34:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erik\_Andersen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3bc359/32.png) [@Erik\_Andersen](https://www.ruby-forum.com/u/Erik_Andersen)\
**Post date:** [January 24, 2006, 5:34pm UTC](https://www.ruby-forum.com/t/config-file-for-lighttpd-for-win-2003-server/96672/1 "2006-01-24T17:34:21Z")

</div>

Hi All

I am having difficulties setting up the lighttpd.conf file for running  
Ruby  
on Rails on my windows 2003 server. I have actually managed to get it up  
and running by trial and error, but it is very slow.

Not fully understanding the lighttpd.conf file I suspect that maybe it  
is  
not running fastcgi, but only cgi since I have heard that this would be  
slow.  
Maybe it it is not necessary to include the mod\_cgi at all ?

My lighttpd.con file i pasted below. Any ideas are most welcome.

## lighttpd.conf

# lighttpd configuration file

# 

# use a it as base for lighttpd 1.0.0 and above

# 

# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $

############ Options you really have to take care of  
####################

## modules to load

# at least mod\_access and mod\_accesslog should be loaded

# all other module should only be loaded if really neccesary

# - saves some time

# - saves memory

server.modules = (  
“mod\_rewrite”,  
“mod\_redirect”,

# “mod\_alias”,

```
                            "mod_access",

```

# “mod\_cml”,

# “mod\_trigger\_b4\_dl”,

# “mod\_auth”,

# “mod\_status”,

# “mod\_setenv”,

```
                            "mod_fastcgi",

```

# “mod\_proxy”,

# “mod\_simple\_vhost”,

# “mod\_evhost”,

# “mod\_userdir”,

```
                            "mod_cgi",

```

# “mod\_compress”,

# “mod\_ssi”,

# “mod\_usertrack”,

# “mod\_expire”,

# “mod\_secdownload”,

# “mod\_rrdtool”,

```
                            "mod_accesslog" )

```

server.document-root = “E:/apache2triad/htdocs/appname/public”

## where to send error-messages to

server.errorlog = “C:/lighttpd/logs/lighttpd.error.log”

# files to check for if …/ is requested

server.indexfiles = ( “index.php”, “index.html”, “dispatch.fcgi” )  
server.error-handler-404 = “/dispatch.fcgi”

# mimetype mapping

mimetype.assign = (  
“.pdf” =\> “application/pdf”,  
“.sig” =\> “application/pgp-signature”,  
“.spl” =\> “application/futuresplash”,  
“.class” =\> “application/octet-stream”,  
“.ps” =\> “application/postscript”,  
“.torrent” =\> “application/x-bittorrent”,  
“.dvi” =\> “application/x-dvi”,  
“.gz” =\> “application/x-gzip”,  
“.pac” =\> “application/x-ns-proxy-autoconfig”,  
“.swf” =\> “application/x-shockwave-flash”,  
“.tar.gz” =\> “application/x-tgz”,  
“.tgz” =\> “application/x-tgz”,  
“.tar” =\> “application/x-tar”,  
“.zip” =\> “application/zip”,  
“.mp3” =\> “audio/mpeg”,  
“.m3u” =\> “audio/x-mpegurl”,  
“.wma” =\> “audio/x-ms-wma”,  
“.wax” =\> “audio/x-ms-wax”,  
“.ogg” =\> “application/ogg”,  
“.wav” =\> “audio/x-wav”,  
“.gif” =\> “image/gif”,  
“.jpg” =\> “image/jpeg”,  
“.jpeg” =\> “image/jpeg”,  
“.png” =\> “image/png”,  
“.xbm” =\> “image/x-xbitmap”,  
“.xpm” =\> “image/x-xpixmap”,  
“.xwd” =\> “image/x-xwindowdump”,  
“.css” =\> “text/css”,  
“.html” =\> “text/html”,  
“.htm” =\> “text/html”,  
“.js” =\> “text/javascript”,  
“.asc” =\> “text/plain”,  
“.c” =\> “text/plain”,  
“.cpp” =\> “text/plain”,  
“.log” =\> “text/plain”,  
“.conf” =\> “text/plain”,  
“.text” =\> “text/plain”,  
“.txt” =\> “text/plain”,  
“.dtd” =\> “text/xml”,  
“.xml” =\> “text/xml”,  
“.mpeg” =\> “video/mpeg”,  
“.mpg” =\> “video/mpeg”,  
“.mov” =\> “video/quicktime”,  
“.qt” =\> “video/quicktime”,  
“.avi” =\> “video/x-msvideo”,  
“.asf” =\> “video/x-ms-asf”,  
“.asx” =\> “video/x-ms-asf”,  
“.wmv” =\> “video/x-ms-wmv”,  
“.bz2” =\> “application/x-bzip”,  
“.tbz” =\> “application/x-bzip-compressed-tar”,  
“.tar.bz2” =\> “application/x-bzip-compressed-tar”  
)

#### accesslog module

accesslog.filename = “C:/lighttpd/logs/access.log”

## deny access the file-extensions

# 

# ~ is for backupfiles from vi, emacs, joe, …

# .inc is often used for code includes which should in general not be

part

# of the document-root

url.access-deny = ( “~”, “.inc” )

$HTTP[“url”] =~ “.pdf$” {  
server.range-requests = “disable”  
}

######### Options that are good to be but not neccesary to be changed  
#######

## bind to port (default: 80)

server.port = 81

## bind to localhost (default: all interfaces)

#Server.bind = “[grisu.home.kneschke.de](http://grisu.home.kneschke.de)”

## error-handler for status 404

#Server.error-handler-404 = “/error-handler.html”  
#Server.error-handler-404 = “/error-handler.php”

## to help the rc.scripts

#Server.pid-file = “/var/run/lighttpd.pid”

## enable debugging

#debug.log-request-header = “enable”  
#debug.log-response-header = “enable”  
#debug.log-request-handling = “enable”  
#debug.log-file-not-found = “enable”

# You need to let Ruby handle .rb, .cgi and .fcgi files

cgi.assign = ( “.rb” =\> “E:/ruby/bin/rubyw.exe”,  
“.fcgi” =\> “E:/ruby/bin/rubyw.exe”,  
“.cgi” =\> “E:/ruby/bin/rubyw.exe”)

# 5 .fcgi spawns seem to work fine for a reasonable load

fastcgi.server = (  
“.fcgi” =\>  
( “appname” =\>  
( “min-procs” =\> 1,  
“max-procs” =\> 2,  
“socket” =\>  
“E:/apache2triad/htdocs/appname/public/tmp/ruby-railsapp.fastcgi”,  
“bin-path” =\>  
“E:/apache2triad/htdocs/appname/public/dispatch.fcgi”,  
“bin-environment” =\> (“RAILS\_ENV” =\> “development”)  
)  
)  
)
