Boa作為一款專為嵌入式系統(tǒng)打造的輕量級Web服務(wù)器,其核心優(yōu)勢在于能夠在嚴(yán)苛的硬件條件下穩(wěn)定運(yùn)行,Boa出色的可定制性和擴(kuò)展?jié)撃苓m用于多種應(yīng)用情境。當(dāng)面對嵌入式裝置或其他計(jì)算資源有限的平臺(tái)時(shí),部署B(yǎng)oa作為Web服務(wù)解決方案顯得尤為適宜。
接下來,將跟各位小伙伴詳細(xì)介紹一下基于ELF 1開發(fā)板移植Boa的方法。
1、Boa官網(wǎng)下載源碼
官網(wǎng)網(wǎng)址:Boa download | SourceForge.net
下載好的Boa源碼為:boa-0.94.13.tar.gz
2、將源碼拷貝到虛擬機(jī)并解壓
elf@ubuntu:~/work/a/boa$ tar xvf boa-0.94.13.tar.gz
elf@ubuntu:~/work/a/boa$ cd boa-0.94.13/src/
elf@ubuntu:~/work/a/boa/boa-0.94.13/src$ . /opt/fsl-imx-x11/4.1.15-2.0.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi
elf@ubuntu:~/work/a/boa/boa-0.94.13/src$ ./configure --host=arm
elf@ubuntu:~/work/a/boa/boa-0.94.13/src$ make
elf@ubuntu:~/work/a/boa/boa-0.94.13/src$ vi compat.h
root@ELF1:~# cd /etc/
root@ELF1:/etc# mkdir boa
root@ELF1:/etc# mkdir -p /www/cgi-bin/
root@ELF1:/etc# mkdir group
elf@ubuntu:~/work/a/boa/boa-0.94.13/src$ scp boa root@192.168.2.98:/etc/boa/
elf@ubuntu:~/work/a/boa/boa-0.94.13/src$ scp ../boa.conf root@192.168.2.98:/etc/boa/
elf@ubuntu:~/work/a/boa/boa-0.94.13/src$ scp /etc/mime.types root@192.168.2.98:/etc/
root@ELF1:~# vi /etc/boa/boa.conf
3、將#ServerName www.your.org.here改為ServerName www.your.org.here
4、將DocumentRoot /var/www改為DocumentRoot /www
5、將ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/改為ScriptAlias /cgi-bin/ /www/cgi-bin/
root@ELF1:/etc# vi /www/index.html
<!DOCTYPE html>
<html xmlns="http://www/w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html;charset-gb2312">
<title>Isaigu_gateway</title>
<style type="text/css">
<!--
.STYLE1{font-size:45px}
body{
background-color: #ADD8E6;
}
-->
</style>
</head>
<body>
<table width="613" height="424" border="0" align="center">
<tr>
<td colspan="2" align="center" valign="middle"><h2
class="STYLE1">Hello ElfBoard
</h2></td>
</tr>
</tr>
<td> </td>
<td> </td>
<tr>
</table>
</body>
</html>
root@ELF1:~# /etc/boa/boa