1.下载boa源码 boa-0.94.13.tar
2.解压 tar zxvf boa-0.94.13.tar.gz
3.cd boa-0.94.13/src
4. ./configure
5.gedit或者vi Makefile 找到Makefile中的 CC = gcc Cpp = gcc -E 如果你的boa要在板子上运行,把gcc改成你的交叉编译器,如果在unbutu上运行此处不必改
6. make make会出错 这是因为少装了 bison和flex 执行命令 sudo apt-get install bison flex
7.再执行make 这时会出现
util.c:100:1: error: pasting "t" and "->" does not give a valid preprocessing token
这时修改src/compat.h 找到
#ifdef HAVE_TM_GMTOFF
#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff
#else
#define TIMEZONE_OFFSET(foo) timezone
#endif
#ifdef HAVE_TM_ZONE
#define TIMEZONE(foo) foo##->tm_zone
#else
#define TIMEZONE(foo) *tzname
#endif
修改成
#ifdef HAVE_TM_GMTOFF
#define TIMEZONE_OFFSET(foo) foo->tm_gmtoff
#else
#define TIMEZONE_OFFSET(foo) timezone
#endif
#ifdef HAVE_TM_ZONE
#define TIMEZONE(foo) foo->tm_zone
#else
#define TIMEZONE(foo) *tzname
#endif
8.编译通过生成在src下的boa
9.配置boa.conf (网上很多就不叙述了)
10.src中的defines.h 中
#define SERVER_ROOT "/etc/boa" 其中/etc/boa是放置配置文件boa.conf的目录,可以根据需要修改
11.使用post方式提交网页给cgi程序,然后网页会停留在post页面,使用
printf("<meta http-equiv=\"refresh\" content=\"1;url=../port.htm\">");
可以刷新页面