# tar -zxvf boa-0.94.13.tar.gz
2 )在src 目录下运行./configure
3 )生成Makefile 文件,修改
CC = arm-linux-gcc
CPP = arm-linux-gcc–E
(1) 将boa.c 文件中以下几行判断去掉即可。
if ( setuid ( 0 ) != - 1 ) {
DIE ( "icky Linux kernel bug!" );
}
(2)
修改文件compat.h P120
#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff
修改成
#define TIMEZONE_OFFSET(foo) (foo)->tm_gmtoff
(3)
把src 文件夹下的config.c 里的if(!server_name){..........} (大概在266 行到286 行之间)注释掉
否则
Error :
./boa
gethostbyname:: Resource temporarily unavailable
(4) 修改 src/log.c
注释掉
if (dup2(error_log, STDERR_FILENO) == -1) {
DIE("unable to dup2 the error log");
}
否则会出现错误:
log.c:73 unable to dup2 the error log:bad file descriptor
//自己出现的问题
//错误1:
root@ubuntu:~/zy/php项目/boa-0.94.13/src# make
yacc -d boa_grammar.y
make: yacc: Command not found
make: *** [y.tab.c] Error 127
解决方法:
root@ubuntu:~/zy/php项目/boa-0.94.13/src# apt-get install bison
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
firefox-locale-zh-hant
。。。
//错误2:
root@ubuntu:~/zy/php项目/boa-0.94.13/src# make
lex boa_lexer.l
make: lex: Command not found
make: *** [lex.yy.c] Error 127
解决方法:
root@ubuntu:~/zy/php项目/boa-0.94.13/src# apt-get install flex
改变板子的属性,为可写:执行一个命令就可以变成可写的 好象是chmod 777自动启动boa :在/etc/profile 中启动boa 即可
4 )make
优化:
#arm-linux-strip boa
这里的优化就是去除 boa 中的调试信息。经过此操作,boa 会由 232K 变成 62K 左右,这个优化是比较常用的做法。