六款小巧的HTTP Server[C语言]
1、micro_httpd - really small HTTP server
特点:
支持安全的 .. 上级目录过滤
支持通用的MIME类型
支持简单的目录
支持目录列表
支持使用 index.html 作为首页
Trailing-slash redirection
程序总共代码才200多行
这个httpd适合学习简单的Web Server编写学习,因为它只有一个简单的框架,只能够处理简单的静态页,可以考虑用来放静态页。
官方地址:http://www.acme.com/software/micro_httpd/
下载地址:http://www.acme.com/software/micro_httpd/micro_httpd_12dec2005.tar.gz
2、mini_httpd - small HTTP server
特点:
支持GET、HEAD、POST方法
支持CGI功能
支持基本的验证功能
支持安全 .. 上级目录功能
支持通用的MIME类型
支持目录列表功能
支持使用 index.html, index.htm, index.cgi 作为首页
支持多个根目录的虚拟主机
支持标准日志记录
支持自定义错误页
Trailing-slash redirection
mini_httpd 也是相对比较适合学习使用,大体实现了一个Web Server的功能,支持静态页和CGI,能够用来放置一些个人简单的东西,不适宜投入生产使用。
官方地址:http://www.acme.com/software/thttpd/
下载地址:http://www.acme.com/software/mini_httpd/mini_httpd-1.19.tar.gz
3、thttpd - tiny/turbo/throttling HTTP server
thttpd中是一个简单,小型,轻便,快速和安全的http服务器:
简单:它能够支持HTTP/1.1协议标准,或者超过了最低水平
小巧:它具有非常少的运行时间,因为它不fork子进程来接受新请求,并且非常谨慎的分配内存(性能对比表:http://www.acme.com/software/thttpd/benchmarks.html)
便携:它能够在大部分的类Unix系统上运行,包括FreeBSD, SunOS 4, Solaris 2, BSD/OS, Linux, OSF等等
快速:它的速度要超过主流的Web服务器(Apache, NCSA, Netscape),在高负载情况下,它要快的多
安全:它努力的保护主机不受到攻击,不中断服务器
thttpd 类似于lighttpd,对于并发请求不使用fork()来派生子进程处理,而是采用多路复用(Multiplex)技术来实现。因此效能很好。同时它还有一个特点就是基于URL的文件流量限制,这对于下载的流量控制而言是非常方便的。象Apache就必须使用插件实现,效率较thttpd低。
thttpd跟lighttpd类似,适合静态资源类的服务,比如图片、资源文件、静态HTML等等的应用,性能应该比较好,同时也适合简单的CGI应用的场合。
官方地址:http://www.acme.com/software/thttpd/
下载地址:http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz
4、lighttpd - light footprint + httpd = LightTPD
Lighttpd是一个德国人领导的开源软件,其根本的目的是提供一个专门针对高性能网站,安全、快速、兼容性好并且灵活的web server环境。具有非常低的内存开销,cpu占用率低,效能好,以及丰富的模块等特点。
lighttpd 是众多OpenSource轻量级的web server中较为优秀的一个。支持FastCGI, CGI, Auth, 输出压缩(output compress), URL重写, Alias等重要功能,而Apache之所以流行,很大程度也是因为功能丰富,在lighttpd上很多功能都有相应的实现了,这点对于apache的用户是非常重要的,因为迁移到lighttpd就必须面对这些问题。
实用起来lighttpd确实非常不错,apache主要的问题是密集并发下,不断的fork()和切换,以及较高(相对于 lighttpd而言)的内存占用,使系统的资源几尽枯竭。而lighttpd采用了Multiplex技术,代码经过优化,体积非常小,资源占用很低,而且反应速度相当快。
利用apache的rewrite技术,将繁重的cgi/fastcgi任务交给lighttpd来完成,充分利用两者的优点,现在那台服务器的负载下降了一个数量级,而且反应速度也提高了一个甚至是2个数量级!
lighttpd 适合静态资源类的服务,比如图片、资源文件、静态HTML等等的应用,性能应该比较好,同时也适合简单的CGI应用的场合。
官方地址:http://www.lighttpd.net/
下载地址:http://www.lighttpd.net/download/lighttpd-1.4.16.tar.gz
5、SHTTPD - Simple HTTPD
Shttpd是另一个轻量级的web server,具有比thttpd更丰富的功能特性,支持CGI, SSL, cookie, MD5认证, 还能嵌入(embedded)到现有的软件里。最有意思的是不需要配置文件!由于shttpd可以嵌入其他软件,因此可以非常容易的开发嵌入式系统的web server,官方网站上称shttpd如果使用uclibc/dielibc(libc的简化子集)则开销将非常非常低。
特点:
小巧、快速、不膨胀、无需安装、简单的40KB的exe文件,随意运行
支持GET, POST, HEAD, PUT, DELETE 等方法
支持CGI, SSL, SSI, MD5验证, resumed download, aliases, inetd模式运行
标准日志格式
非常简单整洁的嵌入式API
dietlibc friendly. NOT that friendly to the uClibc (*)
容易定制运行在任意平台:Windows, QNX, RTEMS, UNIX (*BSD, Solaris, Linux)
由于shttpd可以轻松嵌入其他程序里,因此shttpd是较为理想的web server开发原形,开发人员可以基于shttpd开发出自己的webserver!
官方网站:http://shttpd.sourceforge.net/
下载地址:http://jaist.dl.sourceforge.net/sourceforge/shttpd/shttpd-1.38.tar.gz
6、tinyhttpd
tinyhttpd is a very simple webserver. It is not for production use; instead it is primarily for a learning tool for persons investigating the http protocol and UNIX system calls.
Despite its simple nature, tinyhttpd supports threading and CGI scripts! For more information, see the accompanying README file and the code itself.
tinyhttpd is tested on Sparc Solaris and will probably not run on other operating systems as-is. However, commenting out the line that does threading may be all that is required to port it. I would like to autoconfiscate tinyhttpd at some point in time to help make it more portable.
There is no downloadable release of tinyhttpd, yet. Until then, you can get it by anonymous CVS.
The real homepage for tinyhttpd is the project page
地址:http://tinyhttpd.sourceforge.net/
转载自:http://blog.linuxphp.org/?action=show&id=60
【译】几种Web服务器比较
注意到有这款服务器nginx。没听过,一查有了下文。其中有一个还是听过的。对照翻译了下文。
Apache and IIS are the most common web servers in use today, but they are far from alone. There is a huge amount of web server software out there, both free and commercial.
到目前,Apache和IIS是用的最为普遍的Web服务器,但是它们太过单一,在此之外这里还有许多Web服务器软件,或是免费的或是商业的。
In this article we present four popular alternative web servers: Lighttpd, Nginx, LiteSpeed and Zeus. The first two are free and open source while the other two are commercial, closed-source alternatives. What they all have in common is that they focus on high performance.
本文我们介绍四种最受欢迎的Web服务器: Lighttpd, Nginx, LiteSpeed 和 Zeus。 前两个都是免费且开源的,而另两种都是商业的,闭源的。它们的共同点在于都着重于高性能上。
We will also take a look at how many websites are actually using these web servers.
我们看看有多少网站实际上在使用它们。
But first a brief presentation of each of one:
首先一个简短的介绍其中之一:
Lighttpd
Brief info: Pronounced “Lighty”, Lighttpd is as the name implies a small, lightweight web server which has a low memory footprint and light CPU load. Lighttpd is a good alternative to serve static content but it has also gained recognition in the Ruby on Rails and PHP communities.
Lighttpd 的名称暗示小,轻量级web服务器,占用内存小且cpu负荷低。Lighttpd 是服务于静态内容的不错选择。然而它更被公认为是用在Ruby 和 PHP 上。
Used by: Wikimedia (Wikipedia), Sourceforge, YouTube, The Pirate Bay, Meebo, Imageshack, Sendspace, Mininova.
Cost: Free
Open Source: Yes
OS platforms: Linux, freeBSD, Solaris, MacOS X, Windows (under Cygwin)
Homepage: http://www.oschina.net/p/lighttpd
Nginx
Brief info: Pronounced “engine X”, Nginx is a lightweight web server and reverse proxy. originally written by Igor Sysoev for Rambler.ru (Russia’s second most visited website). Nginx is known for stability and simple configuration in addition to its low resource consumption. It can also act as an IMAP/POP3 proxy.
Nginx 是一款轻量级web服务器和反向代理。最初由Igor Sysoev 编写。它的出名在于其稳定性和简单的配置,除此之外低资源消耗。 还有它可以作为IMAP/POP3协议。
Used by: Yellow Pages, Hulu, Zimbra, the Friends for Sale Facebook app, Rambler, and it also seems that Wordpress.com just started using it instead of LiteSpeed.
Cost: Free
Open Source: Yes
OS platforms: Linux, FreeBSD, Solaris, MacOS X
Homepage: http://www.oschina.net/p/nginx
LiteSpeed
Brief info: LiteSpeed is a commercial web server designed specifically for large websites. One of LiteSpeed’s advantages is that it can read Apache configurations directly which makes it easy to integrate with existing products to replace Apache. The server is lightweight and as the name implies very fast.
LiteSpeed 一种被特别设计用作大型网站的商业web服务器。 其中一个优势就是它能直接读取Apache 的配置信息。并轻易将它现有的产品结合在一起来代替Apache 。这种服务器是轻量级的就如它的名字暗示出非常快。
Used by: Wordpress (until recently at least, but now Wordpress.com appears to be using nginx), Twitter, GigaOm, Bravenet.
Cost: Free to $1,299 depending on the edition.
Open Source: No
OS platforms: Linux, FreeBSD, Solaris, MacOS X
Homepage: http://www.ruanku.com/p/litespeedtech-web-server
Zeus
Brief info: Zeus web server is a high performance web server. It has received PC Magazine Editors’ Choice award and also the eWeek/PC Magazine Innovation in Infrastructure award. Zeus is a highly flexible enterprise product.
Zeus web server 是一个高性能的web服务器。它曾被PC Magazine Editors’ Choice 授过奖并且eWeek/PC Magazine Innovation 也授予过它奖项。Zeus 是一种高度灵活的企业产品。
Used by: Sony, Telefónica, Virgin media, phpBB.
Cost: $1,700 up to two physical CPUs; $850 per additional CPU.
Open Source: No
OS platforms: Linux, FreeBSD, Solaris, HP-UX
Homepage: http://www.ruanku.com/p/zeus-web-server
How many websites are using these web servers?
According to Netcraft, Lighttpd is currently the most common of these four web servers. On April 1, the numbers of websites for each were as follows:
有多少网站在使用它们?
根据Netcraft统计,Lighttpd 是当前这四种服务器中最普遍的。在4月1日统计到的网站数字。
Lighttpd: 1,495,308
Nginx: 1,018,503
LiteSpeed: 668,030
Zeus: 420,477
These positions were not always the same, though. As you can see by the following graph, which shows the numbers from January 2006 to April 2008, the situation has changed significantly over time.
然而这个形势并不一直是一样的。通过下图你可以看到从2006年1月到2008年4月,形势随着时间而改变着。
The graph is based on data from Netcraft (their web server survey archives).
The huge leap for Lighttpd in January-March of 2007 is most likely due to one or more web hosting or domain registration companies switching over to Lighttpd either for their regular pages, or for parked pages, or both. If anyone knows what happened there in more detail, please feel free to let us know in the comments.
2007年1月到3月,很可能归咎于一个或多个web服务商或域名注册公司转变使用Lighttpd 。发生了什么如果有人知道的更详细些……
Interestingly, the number of servers using the Zeus web server has remained quite constant over the last two years, and even decreased a little. That said, it is mainly an enterprise solution, so this is perhaps not so surprising.
非常有趣的是,过去两年使用Zeus 作为服务器的数量维持在一个非常恒定的状态。而且减少了一点点。可以说,它主要是针对企业解决方案。所以从这点上是不值得惊讶的。
The two web servers that have been growing the fastest lately are Nginx and LiteSpeed. Nginx recently passed the one-million-websites mark.
Nginx 和 LiteSpeed 这两种服务器增长速度很快。近来Nginx 已经超过了一百万个站点
These numbers of course still pale next to Apache’s roughly 83 million websites, but there is no doubt that these alternative web servers are gaining in popularity. Who knows, one of them may be just right for you?
当然这些数字对于Apache的大概8300万来说不值一提。但仍无置疑的是这些可供选择的服务器越来越受欢迎。有谁知道,其中之一很可能是非常适合你的?
转载自:http://www.oschina.net/bbs/thread/4056
六款小巧的HTTP Server[C语言]的更多相关文章
- 【转】推荐介绍几款小巧的Web Server程序
原博地址:http://blog.csdn.net/heiyeshuwu/article/details/1753900 偶然看到几个小巧有趣的Web Server程序,觉得有必要拿来分享一下,让大家 ...
- 十六款值得关注的NoSQL与NewSQL数据库--转载
原文地址:http://tech.it168.com/a2014/0929/1670/000001670840_all.shtml [IT168 评论]传统关系型数据库在诞生之时并未考虑到如今如火如荼 ...
- [原创]一款小巧、灵活的Java多线程爬虫框架(AiPa)
1.简介 AiPa 是一款小巧,灵活,扩展性高的多线程爬虫框架. AiPa 依赖当下最简单的HTML解析器Jsoup. AiPa 只需要使用者提供网址集合,即可在多线程下自动爬取,并对一些异常进行处理 ...
- 使用Sublime text 3打造一个小巧但强大的Go语言开发IDE
版权声明:欢迎转载,转载请注明出处! https://blog.csdn.net/iTaacy/article/details/76716049 使用Sublime text 3打造一个小巧但强大的G ...
- Java开发者必备的六款工具
每一位Java程序员都会有套工具来应对工作上的挑战.多年来,Java程序员使用软件来完成他们的工作.有很多工具对他们是有用的,不过对于初入行的人员来说,寻找合适的工具是困难的,并且是浪费时间的.而今天 ...
- 转载>>六款大数据采集平台的架构分析
随着大数据越来越被重视,数据采集的挑战变的尤为突出.今天为大家介绍几款数据采集平台: Apache Flume Fluentd Logstash Chukwa Scribe Splunk Forwar ...
- 六款常见的Linux操作系统推荐
家常常可能因为工作或学习的需要,要使用个操作系统(比如Windows和Linux).大家对Windwos支持的文件系统可能比较熟悉,而对Linux操作系统所支持的文件系统也许比较陌生.下面小编为大家推 ...
- 如何解析EML(邮件)格式的文件以及一款小巧的EML邮件阅读工具
在理解EML格式的时候,先回顾一下历史,这样有助于理解邮件的格式,比如邮件传输时为何会有多种编码方式.此外,理解EML格式也有助于理解HTTP协议. 历史溯源 由于历史原因,我们目前看到的大部分的网络 ...
- 【干货】前端开发者最常用的六款IDE
一.Visual Studio Code 下载地址:https://code.visualstudio.com/ 功能介绍: 微软在2015年4月30日Build 开发者大会上正式宣布了 Visual ...
随机推荐
- Xcode 6 正式版如何创建一个Empty Application
Xcode 6 正式版里面没有Empty Application这个模板,这对于习惯了纯代码编写UI界面的程序员来说很不习惯. 有网友给出了一个解决方法是,把Xcode 6 beta版里面的模板复制过 ...
- jQuery获取循环中的选中单选按钮radio的值
1.<input type="radio" name="testradio" value="jquery获取radio的值" /> ...
- Oracle备份之RMAN
1.备份:物理备份时文件层次的备份,逻辑备份时数据层次的备份,物理备份为主,逻辑备份作为补充.物理备份分为用户管理备份和RMAN备份,前者使用SQL命令和OS的cp命令进行文件备份,后者使用RMAN工 ...
- redis pub/sub 实战: 微信语音识别
2015年5月22日 20:20:20 星期五 效果: 这边对微信说话, 浏览器端及时显示语音识别的文字 注意: 在连接socket.io时, 按下浏览器f12, 如果一直有请求不断的刷, 说明so ...
- 实验二 PHP基本语法实验
实验二 PHP基本语法实验 0 实验准备 0.1实验环境和相关工具软件 具体到的机房环境,请在Windowsxp环境下做本实验: l 操作系统:Windowsxp l Web服务器:Apache ...
- 调试WebService
1.运行WebService的调用程序 2.浏览器中运行asmx,这一步是为了让w3wp.exe出现在下一步的列表中 3.“工具”或“调试”菜单-->附加到进程 (MS为什么把同一功能放在不同的 ...
- Python~函数的参数
def func(a,b,c,*args,**kw): print('a=',a,'b=',b,'c=',c,'args=',args,'kw=',kw) 必选参数,默认参数,可变参数,关键字参数 d ...
- [转]Android下拉刷新完全解析,教你如何一分钟实现下拉刷新功能
版权声明:本文出自郭霖的博客,转载必须注明出处. 转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/9255575 最近项目中需要用到L ...
- 比较两个mysql数据库表结构的差异
需求来源:一个线上系统,一个开发系统,现在要把开发系统更新到线上,但是开发系统的数据库结构与线上的略有差异,所以需要找出两个数据库的表结构差异. 数据库表结构的差异 注:操作均在Linux系统下完成 ...
- java基础学习05(面向对象基础01--类实例分析)
面向对象基础01(类实例分析) 实现的目标 1.如何分析一个类(类的基本分析思路) 分析的思路 1.根据要求写出类所包含的属性2.所有的属性都必须进行封装(private)3.封装之后的属性通过set ...