Tinyhttpd:运行测试【1】
一、问题引入
想分析http开源程序 Tinyhttpd ,首先应复现http server 和 client 之间的请求和相应
开源仓库地址:https://github.com/EZLippi/Tinyhttpd.git
二、解决过程
- git 项目
git clone https://github.com/EZLippi/Tinyhttpd.git
- 准备CGI环境
由于请求需要使用cgi,故要下载:perl 和 perl-CGI
yum install perl
yum install perl-CGI

修改color.cgi中的perl路径以及文件权限和index.html权限
chmod -R 777 color.cgi
chmod -R 666 index.html
修改color.cgi中的cgi的位置


- 编译运行httpd


- http客户端发送请求
输入:pink


三、反思总结
分析、解读开源项目的第一件事不是去看源代码,而是验证项目能否成功运行。
接下来才是分析源码框架和原理。

浙公网安备 33010602011771号