嵌入式Linux:ARM开发板移植Boa搭建Web服务器

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>&nbsp;</td>
                                <td>&nbsp;</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
  • 0
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

R-QWERT

你的鼓励是我最大的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值