boa服务器的移植(包含Ubuntu和ARM板)

发布时间:2026/5/30 1:16:16

boa服务器的移植(包含Ubuntu和ARM板) boa服务器的移植Ubuntu端移植1.源码下载boa官网2.解压文件并进入./boa-0.94.13/src目录tar-xvfboa-0.94.13.tar.gzcdboa-0.94.13/src3.执行./configure配置编译环境./configure4.修改两处源码以防编译报错然后make第一处tongtong-virtual-machine:~/linux/tool/boa_server/boa-0.94.13/src$vicompat.h 120将这一行改为#defineTIMEZONE_OFFSET(foo)(foo)-tm_gmtoff第二处tongtong-virtual-machine:~/linux/tool/boa_server/boa-0.94.13/src$viboa.c 225注释如图所示的区域代码然后尝试下maketongtong-virtual-machine:~/linux/tool/boa_server/boa-0.94.13/src$make5.创建boa的目录tongtong-virtual-machine:~$pwd/home/tong tongtong-virtual-machine:~$mkdirboa tongtong-virtual-machine:~$cdboa/ tongtong-virtual-machine:~/boa$mkdircgi-bin www log6.修改boa.conf配置文件tongtong-virtual-machine:~/linux/tool/boa_server/boa-0.94.13$viboa.conf需要修改的部分如下Port80User0Group0ErrorLog /home/tong/boa/log/error_log AccessLog /home/tong/boa/log/access_log DocumentRoot /home/tong/boa/www UserDir public_html DirectoryIndex index.html DirectoryMaker /home/tong/boa/boa_indexer KeepAliveMax1000KeepAliveTimeout10MimeTypes /home/tong/boa/mime.types ScriptAlias /cgi-bin/ /home/tong/boa/cgi-bin/7.修改defines.h配置文件tongtong-virtual-machine:~/linux/tool/boa_server/boa-0.94.13/src$pwd/home/tong/linux/tool/boa_server/boa-0.94.13/src tongtong-virtual-machine:~/linux/tool/boa_server/boa-0.94.13/src$videfines.h 30箭头处改成#defineSERVER_ROOT/home/tong/boa8.编译tongtong-virtual-machine:~/linux/tool/boa_server/boa-0.94.13/src$makeclean tongtong-virtual-machine:~/linux/tool/boa_server/boa-0.94.13/src$make9.将编译得到的文件移动到你新创建的boa目录下tongtong-virtual-machine:~/linux/tool/boa_server/boa-0.94.13/src$sudocp/etc/mime.types /home/tong/boa/ tongtong-virtual-machine:~/linux/tool/boa_server/boa-0.94.13/src$cpboa /home/tong/boa tongtong-virtual-machine:~/linux/tool/boa_server/boa-0.94.13/src$cpboa_indexer /home/tong/boa tongtong-virtual-machine:~/linux/tool/boa_server/boa-0.94.13/src$cp../boa.conf /home/tong/boa10.实现CGI测试文件tongtong-virtual-machine:~/boa/cgi-bin$pwd/home/tong/boa/cgi-bin tongtong-virtual-machine:~/boa/cgi-bin$touchtest.c tongtong-virtual-machine:~/boa/cgi-bin$vitest.c tongtong-virtual-machine:~/boa/cgi-bin$ gcc test.c-otest.cgitest.c内容#includestdio.hintmain(){printf(Content-type:text/html\n\n);//这句一定要加上printf(htmlbody);printf(font style\color:red; font-size:30px;\Hello, BOA server!/fontbr/);printf(a href\/index.html\return index.html/a);printf(/body/html);return0;}11.实现HTML页面测试文件tongtong-virtual-machine:~/boa/www$pwd/home/tong/boa/www tongtong-virtual-machine:~/boa/www$touchindex.html tongtong-virtual-machine:~/boa/www$viindex.htmlindex.html内容htmlbodyh1this is a boa server test!/h1br/imgsrcimage.jpg/h3tree picture/h3br/ahref/cgi-bin/test.cgito cgi page/a/body/htmlimage.jpg 随便找一张图片放在当前目录注意image.jpg权限tongtong-virtual-machine:~/boa/www$chmod775image.jpg然后到此位置移植完成开始测试12.测试sudo./boa tongtong-virtual-machine:~/boa$ps-ef|grepboa tong16451150018:58 ? 00:00:00 /usr/libexec/gsd-keyboard root83751150020:39 pts/0 00:00:00 ./boa tong83778027020:39 pts/0 00:00:00grep--colorauto boa然后我们打开浏览器输入127.0.0.1然后测试网页.到此Ubuntu端移植结束。ARM端移植ARM板以IMX6ULL型号为例子。这部分参考博客是boa服务器的移植其中前三步与Ubuntu一致。在第4步中额外注释以下内容。然后在板子的目录下创建与Ubuntu中相同的文件夹然后修改boa.conf配置文件注意路径要和你板子boa路径一致。需要修改的部分如下基本与Ubuntu一样只有一行新加ServerName 192.168.1.50板子IP地址直接在最后一行加这行。Port80User0Group0ErrorLog /home/tong/boa/log/error_log AccessLog /home/tong/boa/log/access_log DocumentRoot /home/tong/boa/www UserDir public_html DirectoryIndex index.html DirectoryMaker /home/tong/boa/boa_indexer KeepAliveMax1000KeepAliveTimeout10MimeTypes /home/tong/boa/mime.types ScriptAlias /cgi-bin/ /home/tong/boa/cgi-bin/ ServerName192.168.1.50修改defines.h配置文件与Ubuntu步骤一样注意地址要是板子实际文件地址。然后修改MakeFile文件。先查看交叉编译器是否存在tongtong-virtual-machine:~/linux/tool/boa-0.94.13/src$ arm-linux-gnueabihf-gcc-v然后打开Makefiletongtong-virtual-machine:~/linux/tool/boa-0.94.13/src$viMakefile修改为如图所示然后make编译剩下的步骤和Ubuntu上一致。注意网页上输入的是板子IP地址。

相关新闻