tinyhttpd使用祥解

http://www.oschina.net/p/tinyhttpd
tinyhttpd是一个超轻量型Http Server,使用C语言开发,全部代码只有502行(包括注释),附带一个简单的Client,可以通过阅读这段代码理解一个 Http Server 的本质。
要在linux平台上运行,首先,按照作者的提示,注释掉一些东西:
This program compiles for Sparc Solaris 2.6.
 * To compile for Linux:
 *  1) Comment out the #include <pthread.h> line.
 *  2) Comment out the line that defines the variable newthread.
 *  3) Comment out the two lines that run pthread_create().
 *  4) Uncomment the line that runs accept_request().
 *  5) Remove -lsocket from the Makefile.
因为作者的cgi脚本用的是perl,所以要提前安装perl,并在cgi脚本里 将perl的路径 改成自己的路径。
然后,编译运行:
超轻量型http服务器tinyhttpd的测试 - 布达佩斯的PCB - 布达佩斯的PCB
照这样输入:
超轻量型http服务器tinyhttpd的测试 - 布达佩斯的PCB - 布达佩斯的PCB
提交后,显示颜色,服务器的功能测试完成。
 
超轻量型http服务器tinyhttpd的测试 - 布达佩斯的PCB - 布达佩斯的PCB
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值