关于 Lighttpd for Windows 的问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1583972/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Questions regarding Lighttpd for Windows
提问by crosenblum
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.
我在 windows 上使用 lighty,是的,我知道它不是 linux,但 atm 只能负担得起本地托管,这让我可以做很多学习和练习我的网络技能。
I am aware that fast-cgi, does not work on windows, but I am wondering what other ways, to improve performance are there?
我知道 fast-cgi 在 Windows 上不起作用,但我想知道还有哪些其他方法可以提高性能?
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...
我还想知道如何隐藏所有出现的 lightpd.exe 窗口/框,每次有人或机器人访问该站点时...可以从后台运行 lighttpd 吗?我将它作为服务运行,这很好......
But all in all, why is there so little support for lighty on windows?
但总而言之,为什么 windows 上对 lighty 的支持如此之少?
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...
而且我真的可以不那么关心关于为什么一切都应该在 linux 或 windows 上的更多讲座......那个讨论真的是在浪费时间......我的和你的......
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...
例如,我添加了一个子域,因为 yslow 喜欢图像、css 和 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...
我真的很喜欢 lighty,只是希望我不是唯一一个……在 windows 上使用它……而 windows 站点的所有 lighty 似乎都死了……或者被遗忘了……
Thank You for your time..
感谢您的时间..
-Craig
-克雷格
采纳答案by Alix Axel
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).
我也为 Windows 运行了 lighttpd,但我已经制作了我自己的非常优化的 lighttpd mod,支持 PHP 和 Python,我从 USB 笔式驱动器运行它,因为我切换到 Windows 7,每当我访问时,所有命令行窗口都会出现服务器(我也不知道如何防止这种情况发生)。
I did several things to make my lighttpd server faster (since I run it from a USB pen drive):
我做了几件事来使我的 lighttpd 服务器更快(因为我是从 USB 笔式驱动器运行它的):
- 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)
- 禁用各种日志(特别是访问日志)
- 保持配置文件尽可能小(我的只有 20 行)
- 仅在 .php 文件上激活 PHP,仅在 .py 文件上激活 Python
- 禁用您不需要的各种模块,例如 SSL 等(我只有 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
- mod_access
- mod_cgi
- mod_dirlisting
- mod_index文件
- mod_staticfile
Bottom line is, even when running from the USB pen the server still is blazing fast.
最重要的是,即使从 USB 笔运行,服务器仍然非常快速。
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.
PS:我也考虑过改用 nginx,但考虑到我目前可以获得的性能以及 nginx 更小的用户群,我决定保留 LightTPD。
回答by thenoviceoof
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...
通过本地托管,我猜你的意思是在你自己的盒子上,所以基本上是免费的。如果您的现金不太紧张,您可能会选择一个便宜的盒子,然后在那里安装一个无头 linux。好吧,那只是在您不喜欢将 linux 用作桌面的情况下...
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 mightbe a different story on windows.
因此,首先,由于您只是在学习,我假设您还没有尝试建立生产站点,因此您可以在不使用它时轻松关闭(摆脱弹出的框)机器人)。如果这是不可接受的,请原谅我,因为那里可能有解决方案(以及您如何为沙盒站点获取机器人?oO)。性能也是如此:它只是一个测试场,所以优化应该不会太重要(不要担心:记住过早优化是一切的根源的格言......某事)。如果您仍然想要 fastcgi,那么还有另一个 stackoverflow 问题/答案:Windows 和 Lighttpd上的FastCGI。另外,请查看 scgi,这在 Windows 上可能是另一回事。
Also, here's some thoughts from Atwood on yslow: codinghorror.com/blog/archives/000932.html
此外,以下是 Atwood 在 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.
最后; 最后我查了一下,lighty 远没有 apache 流行,这意味着用户群要小得多。当您还考虑 IIS 时,lighty 在 Windows 下不会真正拥有那么多用户。请注意,如果您想继续在 Windows 上使用 lighttpd,您可能会有一条不太顺利的道路。另请注意,您最终可能会将服务器转移到另一个盒子或异地。我从我的桌面上提供过东西,从长远来看,这并不是很有趣。
回答by ygrek
Try nginx- another lightweight alternative to apache, fast and stable. fastcgi on windows works ok. Regarding your question - I think the reason is that lighttpd is loosing its popularity, look at the web server stats. So less people use it, less features are tested, more bugs are lurking around.
试试nginx——另一个 apache 的轻量级替代品,快速且稳定。Windows 上的 fastcgi 工作正常。关于您的问题 - 我认为原因是 lighttpd 正在失去其受欢迎程度,请查看 Web 服务器统计信息。所以使用它的人越来越少,测试的功能越来越少,更多的错误潜伏着。