小巧的HTTP Server[C语言]

阅读:388 2019-03-19 14:44:02 来源:新网

1、micro_httpd-reallysmallhttpserver特点:支持安全的..上级目录过滤支持通用的mime类型支持简单的目录支持目录列表支持使用index.html作为首页trailing-slashredirection程序总共代码才200多行

这个httpd适合学习简单的webserver编写学习,因为它只有一个简单的框架,只能够处理简单的静态页,可以考虑用来放静态页。官方地址:http://www.acme.com/software/micro_httpd/下载地址:http://www.acme.com/software/micro_httpd/micro_httpd_12dec2005.tar.gz2、mini_httpd-smallhttpserver特点:支持get、head、post方法支持cgi功能支持基本的验证功能支持安全..上级目录功能支持通用的mime类型支持目录列表功能支持使用index.html,index.htm,index.cgi作为首页支持多个根目录的虚拟主机支持标准日志记录支持自定义错误页trailing-slashredirectionmini_httpd也是相对比较适合学习使用,大体实现了一个webserver的功能,支持静态页和cgi,能够用来放置一些个人简单的东西,不适宜投入生产使用。官方地址:http://www.acme.com/software/thttpd/下载地址:http://www.acme.com/software/mini_httpd/mini_httpd-1.19.tar.gz3、thttpd-tiny/turbo/throttlinghttpserverthttpd中是一个简单,小型,轻便,快速和安全的http服务器:简单:它能够支持http/1.1协议标准,或者超过了最低水平小巧:它具有非常少的运行时间,因为它不fork子进程来接受新请求,并且非常谨慎的分配内存(性能对比表:http://www.acme.com/software/thttpd/benchmarks.html)便携:它能够在大部分的类unix系统上运行,包括freebsd,sunos4,solaris2,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.gz4、lighttpd-lightfootprint+httpd=lighttpdlighttpd是一个德国人领导的开源软件,其根本的目的是提供一个专门针对高性能网站,安全、快速、兼容性好并且灵活的webserver环境。具有非常低的内存开销,cpu占用率低,效能好,以及丰富的模块等特点。lighttpd是众多opensource轻量级的webserver中较为优秀的一个。支持fastcgi,cgi,auth,输出压缩(outputcompress),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.gz5、shttpd-simplehttpdshttpd是另一个轻量级的webserver,具有比thttpd更丰富的功能特性,支持cgi,ssl,cookie,md5认证,还能嵌入(embedded)到现有的软件里。最有意思的是不需要配置文件!由于shttpd可以嵌入其他软件,因此可以非常容易的开发嵌入式系统的webserver,官方网站上称shttpd如果使用uclibc/dielibc(libc的简化子集)则开销将非常非常低。特点:小巧、快速、不膨胀、无需安装、简单的40kb的exe文件,随意运行支持get,post,head,put,delete等方法支持cgi,ssl,ssi,md5验证,resumeddownload,aliases,inetd模式运行标准日志格式非常简单整洁的嵌入式apidietlibcfriendly.notthatfriendlytotheuclibc(*)容易定制运行在任意平台:windows,qnx,rtems,unix(*bsd,solaris,linux)由于shttpd可以轻松嵌入其他程序里,因此shttpd是较为理想的webserver开发原形,开发人员可以基于shttpd开发出自己的webserver!官方网站:http://shttpd.sourceforge.net/下载地址:http://jaist.dl.sourceforge.net/sourceforge/shttpd/shttpd-1.38.tar.gz

6、tinyhttpd

tinyhttpdisaverysimplewebserver.itisnotforproductionuse;insteaditisprimarilyforalearningtoolforpersonsinvestigatingthehttpprotocolandunixsystemcalls.

despiteitssimplenature,tinyhttpdsupportsthreadingandcgiscripts!formoreinformation,seetheaccompanyingreadmefileandthecodeitself.

tinyhttpdistestedonsparcsolarisandwillprobablynotrunonotheroperatingsystemsas-is.however,commentingoutthelinethatdoesthreadingmaybeallthatisrequiredtoportit.iwouldliketoautoconfiscatetinyhttpdatsomepointintimetohelpmakeitmoreportable.

thereisnodownloadablereleaseoftinyhttpd,yet.untilthen,youcangetitbyanonymouscvs.

therealhomepagefortinyhttpdistheprojectpage

地址:http://tinyhttpd.sourceforge.net/

转载自:http://blog.linuxphp.org/?action=show&id=60

【译】几种web服务器比较

注意到有这款服务器nginx。没听过,一查有了下文。其中有一个还是听过的。对照翻译了下文。

apacheandiisarethemostcommonwebserversinusetoday,buttheyarefarfromalone.thereisahugeamountofwebserversoftwareoutthere,bothfreeandcommercial.

到目前,apache和iis是用的最为普遍的web服务器,但是它们太过单一,在此之外这里还有许多web服务器软件,或是免费的或是商业的。

inthisarticlewepresentfourpopularalternativewebservers:lighttpd,nginx,litespeedandzeus.thefirsttwoarefreeandopensourcewhiletheothertwoarecommercial,closed-sourcealternatives.whattheyallhaveincommonisthattheyfocusonhighperformance.

本文我们介绍四种最受欢迎的web服务器:lighttpd,nginx,litespeed和zeus。前两个都是免费且开源的,而另两种都是商业的,闭源的。它们的共同点在于都着重于高性能上。

wewillalsotakealookathowmanywebsitesareactuallyusingthesewebservers.

我们看看有多少网站实际上在使用它们。

butfirstabriefpresentationofeachofone:

首先一个简短的介绍其中之一:

lighttpd

nginx

litespeed

zeus

accordingtonetcraft,lighttpdiscurrentlythemostcommonofthesefourwebservers.onapril1,thenumbersofwebsitesforeachwereasfollows:有多少网站在使用它们?根据netcraft统计,lighttpd是当前这四种服务器中最普遍的。在4月1日统计到的网站数字。

lighttpd:1,495,308nginx:1,018,503litespeed:668,030zeus:420,477

thesepositionswerenotalwaysthesame,though.asyoucanseebythefollowinggraph,whichshowsthenumbersfromjanuary2006toapril2008,thesituationhaschangedsignificantlyovertime.

然而这个形势并不一直是一样的。通过下图你可以看到从2006年1月到2008年4月,形势随着时间而改变着。thegraphisbasedondatafromnetcraft(theirwebserversurveyarchives).

thehugeleapforlighttpdinjanuary-marchof2007ismostlikelyduetooneormorewebhostingordomainregistrationcompaniesswitchingovertolighttpdeitherfortheirregularpages,orforparkedpages,orboth.ifanyoneknowswhathappenedthereinmoredetail,pleasefeelfreetoletusknowinthecomments.

2007年1月到3月,很可能归咎于一个或多个web服务商或域名注册公司转变使用lighttpd。发生了什么如果有人知道的更详细些……

interestingly,thenumberofserversusingthezeuswebserverhasremainedquiteconstantoverthelasttwoyears,andevendecreasedalittle.thatsaid,itismainlyanenterprisesolution,sothisisperhapsnotsosurprising.

非常有趣的是,过去两年使用zeus作为服务器的数量维持在一个非常恒定的状态。而且减少了一点点。可以说,它主要是针对企业解决方案。所以从这点上是不值得惊讶的。

thetwowebserversthathavebeengrowingthefastestlatelyarenginxandlitespeed.nginxrecentlypassedtheone-million-websitesmark.

nginx和litespeed这两种服务器增长速度很快。近来nginx已经超过了一百万个站点

thesenumbersofcoursestillpalenexttoapache’sroughly83millionwebsites,butthereisnodoubtthatthesealternativewebserversaregaininginpopularity.whoknows,oneofthemmaybejustrightforyou?

相关文章
{{ v.title }}
{{ v.description||(cleanHtml(v.content)).substr(0,100)+'···' }}
你可能感兴趣
推荐阅读 更多>
推荐商标

{{ v.name }}

{{ v.cls }}类

立即购买 联系客服