一、下载。
版本:boa-0.94.13。
二、配置。
1、进入src目录下,查看帮助。
./configure --help
2、配置。
./configure --prefix=$(pwd)/../buildout/arm-2014.05 --host=arm-linux
3、修改Makefile文件,或在配置前修改Makefile.in文件。
# Change these if necessary
YACC = yacc
LEX = lex
CC = gcc
CPP = gcc -E
# Change these if necessary
YACC = yacc
LEX = lex
CC = arm-linux-gcc
CPP = arm-linux-gcc -E
三、编译与安装。
1、编译报错如下:
ms@ubuntu:~/work/code/web/boa/boa-0.94.13/src$ make -j4
yacc -d boa_grammar.y
make: yacc: Command not found
lex boa_lexer.l
make: lex: Command not found
Makefile:59: recipe for target 'y.tab.c' failed
make: *** [y.tab.c] Error 127
make: *** Waiting for unfinished jobs....
Makefile:62: recipe for target 'lex.yy.c' failed
make: *** [lex.yy.c] Error 127
ms@ubuntu:~/work/code/web/boa/boa-0.94.13/src$
解决:安装。
1、yacc: Command not found
sudo apt-get install bison -y
2、make: lex: Command not found
sudo apt-get install flex -y
2、重新编译报错如下:
In file included from boa.h:50:0,
from util.c:26:
util.c: In function 'get_commonlog_time':
util.c:100:39: error: pasting "t" and "->" does not give a valid preprocessing token
time_offset = TIMEZONE_OFFSET(t);
^
compat.h:120:30: note: in definition of macro 'TIMEZONE_OFFSET'
#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff
^
<builtin>: recipe for target 'util.o' failed
make: *** [util.o] Error 1
解决:修改src文件下的compat.h文件。
#ifdef HAVE_TM_ZONE
#define TIMEZONE(foo) foo##->tm_zone
#else
#define TIMEZONE(foo) *tzname
#endif
修改为:
#ifdef HAVE_TM_ZONE
#define TIMEZONE(foo) foo->tm_zone
#else
#define TIMEZONE(foo) *tzname
#endif
3、重新编译与安装。
四、移植。
1、拷贝./src下的boa文件至arm板中的/usr/sbin。
2、拷贝./boa.conf文件至arm板中的/etc/boa下。
3、创建文件夹/usr/boa/www。
4、加入开机启动。
/usr/sbin/boa