Questions regarding Lighttpd for Windows

fastcgi, lighttpd, php, windows

Solution

I also run lighttpd for Windows, but I've made my own very well optimized lighttpd mod with PHP and Python support which I run from a USB pen drive, since I switched to Windows 7 all the command line windows keep appearing whenever I access the server (I also don't know how to keep this from happening).

I did several things to make my lighttpd server faster (since I run it from a USB pen drive):

- disable all kinds of logs (specially access logs)

- keep the config file as small as possible (mine has only 20 lines)

- activate PHP only on .php files, Python only on .py files

- disable all kinds of modules that you don't need, like SSL and so on (I only have 5)

Here it is, my config file:

var.Doo = "C:/your/base/path/here"

# LightTPD Configuration File

server.port = 80
server.name = "localhost"
server.tag = "LightTPD/1.4.20"
server.document-root = var.Doo + "/WWW/"
server.upload-dirs = ( var.Doo + "/TMP/" )
server.errorlog = var.Doo + "/LightTPD/logs/error.log"
server.modules = ( "mod_access", "mod_cgi", "mod_dirlisting", "mod_indexfile", "mod_staticfile" )

# mod_access
url.access-deny = ( ".db" )

# mod_cgi
cgi.assign = ( ".php" => var.Doo + "/PHP/php-cgi.exe", ".py" => var.Doo + "/Python/python.exe" )

# mod_dirlisting
dir-listing.activate = "enable"

# mod_indexfile
index-file.names = ( "index.php", "index.html" )

# mod_mimetype
mimetype.assign = ( ".css" => "text/css", ".gif" => "image/gif", ".html" => "text/html", ".jpg" => "image/jpeg", ".js" => "text/javascript", ".png" => "image/png", ".txt" => "text/plain", ".xml" => "text/xml" )

# mod_staticfile
static-file.exclude-extensions = ( ".php", ".py" )

And the modules that I've active:

- mod_access

- mod_cgi

- mod_dirlisting

- mod_indexfile

- mod_staticfile

Bottom line is, even when running from the USB pen the server still is blazing fast.

PS: I also considered switching to nginx but given the current performance I can get and the even smaller user base of nginx I decided I would keep LightTPD.

Problem

I am using lighty for windows, yes i know it's not linux, but atm can only afford local hosting, which then allows me to do a lot of learning and practicing my web skills. I am aware that fast-cgi, does not work on windows, but I am wondering what other ways, to improve performance are there? Also I was wondering how to hide all those lightpd.exe window/boxes that come up, everytime anyone or a bot visits the site...can lighttpd be run from the background? I am running it as a service, and that is fine... But all in all, why is there so little support for lighty on windows? And I really could care less for 1 more lecture on why everything should be on linux or windows...That discussion is really a waste of time...mine and yours... If you have some useful information, I definitely want to hear it. I guess I am one of those guys, who always wants to learn how to improve things, it's like a drug for me, to eak out any percent more in performance... Like for example, I have added a subdomain, because yslow loves subdomain hosting of images,css and javascript... I really like lighty, just hope I am not the only one there...using it on windows...and all the lighty for windows sites seem to be dead...or forgotten... Thank You for your time.. -Craig

Original source