Lighttpd 轻量级服务端

前言

在lighttpd.net的官网上这样介绍这款服务器软件:

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是一款完整的服务器软件,符合服务器的统一标准,包含了apache中的Cgi/Fcgi,Rewrite,Access等组建。
  • lighttpd突出了轻量级,内存占用非常之少,可以节省下来大量内存给应用和磁盘缓存。此外单进程减少很多不必要的 context switch , 在慢网并发连接时候非常明显了。
  • lighttpd是一款BSD的开源软件
在这个地方有lighttpd,apache,nginx三款软件的比较: http://down.chinaz.com/server/201111/1366_1.htm

本来是学习CGI,需要服务器软件,以前都是用apache,感觉它很大,所以就选择这款比较小的服务器作为服务器学习的开端。这篇文章会有各种学习过程的记录。仅供个人记录,勿喷!

让lighttpd支持CGI

通过修改lighttpd的配置文件lighttpd.conf使其支持CGI。
(1)使用语句 server.modules = ("mod_cgi") 加入 cgi 模块;
(2)使用语句 cgi.assign = (".cgi" => "") 设置 cgi 模块的扩展名和解释器。就本语句而言,表示cgi模块的扩展名是“.cgi”且该 cgi 模块不需要特别的解释器来执行。
server.document-root = "/home/gss/workspace_c/web/"
server.port = 3000

server.modules = ("mod_cgi")
cgi.assign = (".cgi"=>"")


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值