1.下载官方网站

http://www.boa.org/

我下载的是0.94.13版本

2.解压

tar -zxvf boa-0.94.13.tar.gz

3.进入src目录

./configure

配置一下生成makefile文件

4.修改makefile

CC = gcc 
CPP = gcc -E

改为

CC = arm-none-linux-gnueabi-gcc
CPP = arm-none-linux-gnueabi-gcc -E

5.修改 src/compat.h
 #define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff
 ->#define TIMEZONE_OFFSET(foo) foo->tm_gmtoff
 修改错误util.c:100:1: error: pasting "t" and "->" does not give a valid preprocessing token

6.修改src/boa.c
   DIE("icky Linux kernel bug!"); -> ;//DIE("icky Linux kernel bug!");
 boa.c:226 - icky Linux kernel bug!: Success(这个错误要查看后面提到error_log文件才能发现)

7.make

编译生成boa文件

8.将boa文件拷贝到目标文件系统的/bin目录下

9.进入目标文件系统,创建/etc/boa目录

10.拷贝压缩包解压目录下的boa.conf 文件到/etc/boa目录下

11.修改boa.conf文件
 User nobody -> User root
 Group nogroup -> Group 0
 MimeTypes /etc/mime.types -> MimeTypes /etc/boa/mime.types
 ErrorLog /var/log/boa/error_log -> ErrorLog /etc/boa/error_log
 AccessLog /var/log/boa/access_log -> AccessLog /etc/boa/access_log
 DocumentRoot /var/www -> DocumentRoot /etc/boa/html
 #ServerName www.your.org.here -> ServerName www.your.org.here
  错误:gethostbyname:: Resource temporarily unavailable
 ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ ->ScriptAlias /cgi-bin/ /etc/boa/cgi-bin/

12.目标文件系统中创建/etc/boa/html目录 修改属性777

13.拷贝index.html主页到/etc/boa/html目录下 chmod a-x *.html修改属性
 错误:403 Forbidden The requested URL '/' resolves to a file which is marked executable but is not a CGI file; retrieving it is forbidden.

14.修改启动脚本 添加boa &

15.目标文件系统/etc/boa目录下创建access_log error_log文件 属性777

16.目标文件系统/etc/boa目录下创建cgi-bin目录

17.复制ubuntu /etc/mime.type文件到目标板/etc/boa下
 错误:Could not open mime.types file, "/etc/mime.types", for reading

18.Port 80 -> Port 8080 那么测试地址xxx.xxx.xxx.xxx:8080
 错误:unable to bind: Address already in use(这个错误要查看error_log文件才能发现)

如果不存在错误则port 80可以,那么测试地址为ip地址xxx.xxx.xxx.xxx

05-11 16:03