免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1119 | 回复: 0
打印 上一主题 下一主题

boa 移植到arm-linux上 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-08-29 15:45 |只看该作者 |倒序浏览
1、从www.boa.org上下载源代码
    $ cd ~/arm/source/boa
    $ wget -c http://www.boa.org/boa-0.94.13.tar.gz
2、编译运行
    $ tar zxf boa-0.94.13.tar.gz
    $ cd boa-0.94.13/
    $ cd src
    $ ./configure
    修改Makefile:
    CC = arm-linux-gcc
    CPP = arm-linux-gcc -E
    现在开始编译:
    $ make
    这时候出现了没有yacc和lex的错误,需要安装一下, ubuntu下对应为bison和flex:
    $ sudo apt-get install bison flex
    注: bison-- A parser generator that is compatible with YACC
    然后再次编译:
    $ make
    util.c:100:1: pasting "t" and "->" does not give a valid preprocessing token
    make: *** [util.o] 错误 1
    解决办法:   
    修改 src目录下 compat.h 中:
    #define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff 为:
    #define TIMEZONE_OFFSET(foo) (foo)->tm_gmtoff
   
    然后重新编译一下:
    $ make clean; make
   
    strip一下目标文件:
    $ arm-linux-strip boa
3. boa的配置
   Boa需要在/etc目录下建立一个boa目录,里面放入Boa的主要配置文件
   boa.conf。在Boa源码目录下已有一个示例boa.conf,可以在其基础上进行修改:
   1)确保passwd中有nobody用户,group中有nogroup组, 否则要将: Group nogroup 改为 Group
   0, User nobody 改为User 0
   其他的配置选项如下:
   ServerName www.your.org.here
   #AccessLog /var/log/boa/access_log
   #ErrorLog /var/log/boa/error_log
   DirectoryMaker /web/lib/boa_indexer
   ScriptAlias /cgi-bin/ /web/cgi-bin/
   其余的用默认吧。
   2)mkdir /web;cd web;
     mkdir cgi-bin lib html
       然后将boa/src目下的boa_indexer拷贝到/web/lib下.
       同时从host上拷贝/etc/mime.types 到目标板上的/etc目下。
4. Boa 测试:
   1)html
   $ cat  web/html/index.html
    srp-boa test   
   
   
Hello, I am from boa!
   
   Great Linux!!
   sh cgi test
   c cgi test
   
   2) cgi
   $ cat web/cgi-bin/sh.cgi
     #!/bin/sh
      echo "Content-type: text/html"
     echo
     echo
     echo "shell test"
     echo ""
     echo "hello, this is the output from shell"
     echo "
done!"
     echo ""
   
   $ cat test.c
   #include
   #include
   int main(void)
     {
          printf("Content-type: text/html\n\n");
          printf("\n");
          printf("CGI Output\n");
          printf("\n");
          printf("Hello,This is the cgi-script\n");
          printf("\n");
          printf("\n");
          exit(0);
     }
     arm-linux-gcc -o c.cgi test.c
     将sh.cgi和c.cgi拷贝到目标板/web/cgi-bin/下
      
   测试: http://192.168.0.34
      
      


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/56406/showart_1157848.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP