1、官网www.boa.org下载boa-0.94.13.tar.gz
2、将整个压缩包放到虚拟机ubuntu下解压,进入boa-0.94.13/src/目录执行./configure命令生成Makefile
3、修改Makefile内容,修改交叉编译工具,根据自己配置的开发板环境,这里使用arm-linux-
4、修改compat.h后make编译
5、编译得到boa文件之后执行arm-linux-strip boa瘦下身
6、把boa文件拷贝到开发板/bin/目录上
7、开发板分别创建/etc/boa、/www/cgi-bin目录
8、拷贝boa-0.94.13目录下面的boa.conf到开发板/etc/boa目录
9、拷贝虚拟机的/etc/mime.types到开发板/ect/目录
10、在开发板/etc/目录vi group文件,内容为:
root:*:0:
11、修改开发板/etc/boa/boa.conf内容
① Group nogroup修改为Group root
② #ServerName www.your.org.here修改为ServerName www.your.org.here
③ DocumentRoot /var/www修改为DocumentRoot /www(前面创建的目录)
④ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/修改为ScriptAlias /cgi-bin/ /www/cgi-bin/
12、在启动脚本etc/init.d/rcS或其他文件添加boa &开机后台执行
13、在开发板/www/目录vi创建index.html文件,内容为:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=gb2312" />
<title>my arm board as server</title>
<style
type="text/css">
<!--
.STYLE1 {font-size: 36px}
body {
background-color: #996600;
}
-->
</style>
</head>
<body>
<table
width="613"
height="424"
border="0"
align="center">
<tr>
<td colspan="2" align="center" valign="middle">
<h2
class="STYLE1">Hello world!
</h2>
</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
14、完成上面步骤以后,服务器基本已经完成了,在开发板与电脑同一网段情况下,直接在浏览器上面输入开发板的IP地址即可访问。
移植过程中,有可能会出现一些小问题,例如:
① unable to dup2 the error log
解决:修改boa源码src/log.c重新编译
#if 0
if (dup2(error_log, STDERR_FILENO) == -1) {
DIE("unable to dup2 the error log");
}
#endif