位置:51电子网 » 技术资料 » 嵌入式系统

嵌入式web服务器boa的移植笔记

发布时间:2008/5/27 0:00:00 访问次数:698

http://www.avrw.com

  关于boa的移植并不是很难,也有很多文档。在这里我只把我个人移植过程中经验和大家分享下,希望能对大家的学习有帮助。

  我是在uclinux下移植的boa。uclinux跑通后,要看看网卡有没有通,用板子ping主机或者主机ping板子都是可以的。如果这个不通的话,后面就没办法做了。

  我的网卡是rtl8019。因为我的uboot调通了网卡,我只是在编译内核的时候,把网卡的一些选项添加进去了。启动的时候uclinux就可以识别网卡。

boa的关键就是配置文件。大部分时间我都在调试这个配置文件!

  第一步makemenuconfig,然后在networkapplication中选择boa。
  第二步修改boa/src/define.h文件home/web(文件路径可以根据个人喜欢定义)
  第三步修改44b0下的makefile文件romfs_dirs后面加上home/web路径。
  第四步配置boa..conf文件,这个文件在boa/example下面
  第五步把index.html(自己写)boa.conf和mime.types拷贝到home/web下面
  第六步下载到板子上开始启动boa。我是通过命令启动也可以让其随系统自己启动。命令boa–c/home/web&。自启动的话,就在rc文件中添加。然后输入主机输入板子的ip就可以看见index.html的内容了。

  备注:板子的ip要正确配置,通过ifconfig这个命令,在rc的文件中。

  附件:我个人的boa配置文件
#port:theportboarunson.thedefaultportforhttpserversis80.
#ifitislessthan1024,theservermustbestartedasroot.
port80
#user:thenameoruidtheservershouldrunas.
#group:thegroupnameorgidtheservershouldrunas.
user0
group0
#serveradmin:theemailaddresswhereserverproblemsshouldbesent.
#note:thisisnotcurrentlyused.
serveradminroot@localhost
#errorlog:thelocationoftheerrorlogfile.ifthisdoesnotstart
#with/,itisconsideredrelativetotheserverroot.
#setto/dev/nullifyoudon’twanterrorslogged.
errorlog/var/log/boa/error_log
#accesslog:thelocationoftheaccesslogfile.ifthisdoesnot
#startwith/,itisconsideredrelativetotheserverroot.
#commentoutorsetto/dev/null(lesseffective)todisable
#accesslogging.
accesslog/var/log/boa/access_log
#refererlog:thelocationoftherefererlogfile.ifthisdoesnot
#startwith/,itisconsideredrelativetotheserverroot.
#commentoutorsetto/dev/null(lesseffective)todisable
#refererlogging.
refererlog/var/log/boa/referer_log
#agentlog:thelocationoftheagentlogfile.ifthisdoesnot
#startwith/,itisconsideredrelativetotheserverroot.
#commentoutorsetto/dev/null(lesseffective)todisable
#user-agentlogging.
agentlog/var/log/boa/agent_log
#verbosecgilogs:thisisjustalogicalswitch.
#commentouttodisable.





http://www.avrw.com

  关于boa的移植并不是很难,也有很多文档。在这里我只把我个人移植过程中经验和大家分享下,希望能对大家的学习有帮助。

  我是在uclinux下移植的boa。uclinux跑通后,要看看网卡有没有通,用板子ping主机或者主机ping板子都是可以的。如果这个不通的话,后面就没办法做了。

  我的网卡是rtl8019。因为我的uboot调通了网卡,我只是在编译内核的时候,把网卡的一些选项添加进去了。启动的时候uclinux就可以识别网卡。

boa的关键就是配置文件。大部分时间我都在调试这个配置文件!

  第一步makemenuconfig,然后在networkapplication中选择boa。
  第二步修改boa/src/define.h文件home/web(文件路径可以根据个人喜欢定义)
  第三步修改44b0下的makefile文件romfs_dirs后面加上home/web路径。
  第四步配置boa..conf文件,这个文件在boa/example下面
  第五步把index.html(自己写)boa.conf和mime.types拷贝到home/web下面
  第六步下载到板子上开始启动boa。我是通过命令启动也可以让其随系统自己启动。命令boa–c/home/web&。自启动的话,就在rc文件中添加。然后输入主机输入板子的ip就可以看见index.html的内容了。

  备注:板子的ip要正确配置,通过ifconfig这个命令,在rc的文件中。

  附件:我个人的boa配置文件
#port:theportboarunson.thedefaultportforhttpserversis80.
#ifitislessthan1024,theservermustbestartedasroot.
port80
#user:thenameoruidtheservershouldrunas.
#group:thegroupnameorgidtheservershouldrunas.
user0
group0
#serveradmin:theemailaddresswhereserverproblemsshouldbesent.
#note:thisisnotcurrentlyused.
serveradminroot@localhost
#errorlog:thelocationoftheerrorlogfile.ifthisdoesnotstart
#with/,itisconsideredrelativetotheserverroot.
#setto/dev/nullifyoudon’twanterrorslogged.
errorlog/var/log/boa/error_log
#accesslog:thelocationoftheaccesslogfile.ifthisdoesnot
#startwith/,itisconsideredrelativetotheserverroot.
#commentoutorsetto/dev/null(lesseffective)todisable
#accesslogging.
accesslog/var/log/boa/access_log
#refererlog:thelocationoftherefererlogfile.ifthisdoesnot
#startwith/,itisconsideredrelativetotheserverroot.
#commentoutorsetto/dev/null(lesseffective)todisable
#refererlogging.
refererlog/var/log/boa/referer_log
#agentlog:thelocationoftheagentlogfile.ifthisdoesnot
#startwith/,itisconsideredrelativetotheserverroot.
#commentoutorsetto/dev/null(lesseffective)todisable
#user-agentlogging.
agentlog/var/log/boa/agent_log
#verbosecgilogs:thisisjustalogicalswitch.
#commentouttodisable.





相关IC型号

热门点击

 

推荐技术资料

DFRobot—玩的就是
    如果说新车间的特点是“灵动”,FQPF12N60C那么... [详细]
版权所有:51dzw.COM
深圳服务热线:13692101218  13751165337
粤ICP备09112631号-6(miitbeian.gov.cn)
公网安备44030402000607
深圳市碧威特网络技术有限公司
付款方式


 复制成功!