嵌入式web服務(wù)器boa的移植筆記
http:// 關(guān)于boa的移植并不是很難,也有很多文檔。在這里我只把我個(gè)人移植過程中經(jīng)驗(yàn)和大家分享下,希望能對(duì)大家的學(xué)習(xí)有幫助。
我是在uclinux下移植的boa。uclinux跑通后,要看看網(wǎng)卡有沒有通,用板子ping主機(jī)或者主機(jī)ping板子都是可以的。如果這個(gè)不通的話,后面就沒辦法做了。
我的網(wǎng)卡是rtl8019。因?yàn)槲业膗boot調(diào)通了網(wǎng)卡,我只是在編譯內(nèi)核的時(shí)候,把網(wǎng)卡的一些選項(xiàng)添加進(jìn)去了。啟動(dòng)的時(shí)候uclinux就可以識(shí)別網(wǎng)卡。
boa的關(guān)鍵就是配置文件。大部分時(shí)間我都在調(diào)試這個(gè)配置文件!
第一步makemenuconfig,然后在networkapplication中選擇boa。
第二步修改boa/src/define.h文件home/web(文件路徑可以根據(jù)個(gè)人喜歡定義)
第三步修改44b0下的makefile文件romfs_dirs后面加上home/web路徑。
第四步配置boa..conf文件,這個(gè)文件在boa/example下面
第五步把index.html(自己寫)boa.conf和mime.types拷貝到home/web下面
第六步下載到板子上開始啟動(dòng)boa。我是通過命令啟動(dòng)也可以讓其隨系統(tǒng)自己啟動(dòng)。命令boa–c/home/web&。自啟動(dòng)的話,就在rc文件中添加。然后輸入主機(jī)輸入板子的ip就可以看見index.html的內(nèi)容了。
備注:板子的ip要正確配置,通過ifconfig這個(gè)命令,在rc的文件中。
附件:我個(gè)人的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.