适用于 Windows 的最佳轻量级 Web 服务器(仅限静态内容)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5050851/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 08:04:54  来源:igfitidea点击:

Best lightweight web server (only static content) for Windows

windowshttpwebserverstatic-content

提问by bensiu

I got application server running in Windows – IIS6.0 with Zend Server to execute PHP. I am looking for lightweight static content only web server on this same machine which will relive IIS form handling static content and increase performance.

我让应用服务器在 Windows 中运行——IIS6.0 和 Zend Server 来执行 PHP。我正在同一台机器上寻找仅轻量级静态内容的 Web 服务器,它将重温处理静态内容的 IIS 表单并提高性能。

It need to be only static content web server – maximum small and maximum effective – lighttpd seems too big because allow to FastCGI.

它只需要是静态内容的 web 服务器——最大的小和最大的有效——lighttpd 看起来太大了,因为允许 FastCGI。

I am looking for: Windows, static content only, fast, and lightweight.

我正在寻找:Windows、仅静态内容、快速且轻量级的.

I am using Windows Server 2003.

我正在使用 Windows Server 2003。

采纳答案by ARF

Have a look at mongoose:

看看猫鼬

  • single executable
  • very small memory footprint
  • allows multiple worker threads
  • easy to install as service
  • configurable with a configuration file if required
  • 单个可执行文件
  • 非常小的内存占用
  • 允许多个工作线程
  • 易于安装为服务
  • 如果需要,可以使用配置文件进行配置

回答by eSniff

You can use Python as a quick way to host static content. On Windows, there are many options for running Python, I've personally used CygWin and ActivePython.

您可以使用 Python 作为托管静态内容的快捷方式。在 Windows 上,运行 Python 有很多选择,我个人使用过 CygWin 和 ActivePython。

To use Python as a simple HTTP serverjust change your working directory to the folder with your static content and type python -m SimpleHTTPServer 8000, everything in the directory will be available at http:/localhost:8000/

要将 Python 用作简单的 HTTP 服务器,只需将您的工作目录更改为包含静态内容和类型的文件夹,python -m SimpleHTTPServer 8000该目录中的所有内容都可以在http:/localhost:8000/

Python 3

蟒蛇 3

To do this with Python, 3.4.1 (and probably other versions of Python 3), use the http.servermodule:

要使用 Python 3.4.1(可能还有其他版本的 Python 3)执行此操作,请使用以下http.server模块:

python -m http.server <PORT>
# or possibly:
python3 -m http.server <PORT>

# example:
python -m http.server 8080

On Windows:

在 Windows 上:

py -m http.server <PORT>

回答by Ophir Yoktan

The smallest one I know is lighttpd.

我所知道的最小的一个是 lighttpd。

Security, speed, compliance, and flexibility -- all of these describe lighttpd (pron. lighty) which is rapidly redefining efficiency of a webserver; as it is designed and optimized for high performance environments. With a small memory footprint compared to other web-servers, effective management of the cpu-load, and advanced feature set (FastCGI, SCGI, Auth, Output-Compression, URL-Rewriting and many more) lighttpd is the perfect solution for every server that is suffering load problems. And best of all it's Open Source licensed under the revised BSD license.

安全性、速度、合规性和灵活性——所有这些都描述了 lighttpd(代名词 lighty),它正在迅速重新定义网络服务器的效率;因为它是为高性能环境而设计和优化的。与其他网络服务器相比,内存占用小,cpu 负载的有效管理和高级功能集(FastCGI、SCGI、Auth、输出压缩、URL 重写等)是每个服务器的完美解决方案这就是负载问题。最重要的是,它是根据修订后的 BSD 许可证获得的开源许可。

Edit: removed Windows version link, now a spam/malware plugin site.

编辑:删除了 Windows 版本链接,现在是垃圾邮件/恶意软件插件站点。

回答by James Crook

Consider thttpd. It can run under windows.

考虑thttpd。它可以在windows下运行。

Quoting wikipedia:

引用维基百科:

"it is uniquely suited to service high volume requests for static data"

“它特别适合为静态数据的大量请求提供服务”

A version of thttpd-2.25b compiled under cygwin with cygwin dll's is available. It is single threaded and particularly good for servicing images.

可以使用在 cygwin 下使用 cygwin dll 编译的 thttpd-2.25b 版本。它是单线程的,特别适合服务图像。

回答by ypercube??

You can try running a simple web server based on Twisted

您可以尝试运行基于 Twisted简单 Web 服务器

回答by das_weezul

I played a bit with Rupy. It's a pretty neat, open source (GPL) Java application and weighs less than 60KB. Give it a try!

我玩了一下Rupy。这是一个非常简洁的开源 (GPL) Java 应用程序,重量不到 60KB。试一试!

回答by ProfK

Have a look at Cassini. This is basically what Visual Studio uses for its built-in debug web server. I've used it with Umbracoand it seems quite good.

看看卡西尼号。这基本上是 Visual Studio 用于其内置调试 Web 服务器的内容。我已经将它与Umbraco一起使用了,看起来还不错。