Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Questions regarding Lighttpd for Windows

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

like image 246
crosenblum Avatar asked Oct 18 '09 04:10

crosenblum


2 Answers

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.

like image 183
Alix Axel Avatar answered Nov 12 '22 10:11

Alix Axel


By local hosting, I'm guessing you mean on your own box, so essentially free. If you're not too strapped for cash, you could probably pick up a cheap box, and install a headless linux on there. Well, that's only if you're adverse to using linux as a desktop...

So, first, since you're only learning, I'm assuming you're not trying to put up a production site yet, so you can shut down lighty when you're not using it (getting rid of the boxes popping up for bots). Excuse me if this is unacceptable, since there is probably a solution out there (and how are you getting bots for a sandbox site? oO). Same goes for the performance: it's just a testing grounds, so optimization shouldn't matter too much yet (don't worry about it: remember the maxim that premature optimization is the root of all... something). If you still want fastcgi, there's another stackoverflow question/answer on that: FastCGI on Windows and Lighttpd. Also, check out scgi, which might be a different story on windows.

Also, here's some thoughts from Atwood on yslow: codinghorror.com/blog/archives/000932.html

Finally; last I checked, lighty was no where near as popular as apache, meaning a much smaller user base. When you also consider IIS, then lighty wouldn't really have that many users under Windows. Just noting, you might have a not-so-smooth road ahead of you if you want to continue with lighttpd on windows. Also note, you'll probably end up shifting the server to another box or offsite eventually. I've served stuff from my desktop, and it's not all too fun in the long run.

like image 34
thenoviceoof Avatar answered Nov 12 '22 10:11

thenoviceoof