参考:tq移植手册
tek 大侠博客 天行健的Blog1.移植boa软件 1.下载: 最新的是boa-0.94.13.tar.gz
2.解压:tar zxfv boa-0.94.13.tar.gz 如果出错,去掉v
3.cd /boa-0.84.13/src
4. ./configure
5.vim Makefile
CC=arm-linux-gcc
CPP=arm-linux-gcc -E
6.vim src/boa.c 在行225到227 之间,注释掉
if(setuid(0)!==-1){
DIE("icky linux kernel bug");
}
7.vim src/compat.h 120行
#define TIMEZONE_OFSET(foo) foo->tm_gmtoff
8.编译 make
9.arm-linux-strip boa 去掉 调试信息
2.移植cgic库
1.下载:
2.解压 tar zxfv cgic205.tar.gz 如果出错,去掉v
3.cd cgic205
4.vim Makefile
- CFLAGS=-g -Wall
-
CC=arm-linux-gcc ###这里修改
-
AR=arm-linux-ar
-
RANLIB=arm-linux-ranlib
-
LIBS=-L./ -lcgic
-
-
all: libcgic.a cgictest.cgi capture
-
-
install: libcgic.a
-
cp libcgic.a /home/ywx/arm-cross/arm-2010.09/arm-none-linux-gnueabi/libc/armv4t/lib ##这里修改
-
cp cgic.h /home/ywx/arm-cross/arm-2010.09/arm-none-linux-gnueabi/libc/usr/include ##这里修改
-
@echo libcgic.a is in /usr/local/lib. cgic.h is in /usr/local/include.
-
-
libcgic.a: cgic.o cgic.h
-
rm -f libcgic.a
-
$(AR) rc libcgic.a cgic.o
-
$(RANLIB) libcgic.a
-
-
#mingw32 and cygwin users: replace .cgi with .exe
-
-
cgictest.cgi: cgictest.o libcgic.a
-
$(CC) $(CFLAGS) cgictest.o -o cgictest.cgi ${LIBS} ###这里修改
-
-
capture: capture.o libcgic.a
-
$(CC) $(CFLAGS) capture.o -o capture ${LIBS} ####这里修改
-
-
clean:
-
rm -f *.o *.a cgictest.cgi capture
5.make
6.arm-linux-strip capture
3.配置 boa
1.复制 cp ../boa-0.94.13/src/boa /opt/me_linux/root-2.6.33/sbin/
cp ../boa-0.94.13/boa.conf /opt/me_linux/root-2.6.33/etc/boa/
相应的文件夹要自己建立
2.vim boa.conf
boa_conf.rar 下载后,解压文件,修改为boa.conf 这里列出重要的选项
- DocumentRoot /web 这是存放HTML文档的主目录。
DirectoryIndex index.html HTML目录索引的文件名
ScriptAlias /cgi-bin/ /web/cgi-bin/
指明CGI脚本的循迹路径对应的时间路径。一般所有的CGI脚本都要放在实际路径里,用户访问执行是输入站点+虚拟路径+CGI脚本名。前面的/cgi-bin/就是虚拟路径,/web/cgi-bin就是实际的路径
4.cp /etc/mime.types /opt/me_linux/root-2.6.33/etc
3.配置 cgic 库
1.cd root-2.6.33/web 可以存放 html 文档
2.mkdir cgi-bin #这个文件夹就是存放 cgi
3.cp ../cgic205/capture /opt/me_linux/root-2.6.33/web/cgi-bin/
cp ../cgic205/cgictest.cgi /opt/me_linux/root-2.6.33/web/cgi-bin/
cp index.html ../root-2.6.33/web/index.html
index.html 是我的 chinaunix微博的主要内容
注意这里的 后缀名, 是 html 4.执行
- [root@yuweixian /]# /etc/rc.d/init.d/httpd start
- [01/Jan/1970:00:00:29 +0000] boa: server version Boa/0.94.13
[root@yuweixian /]# [01/Jan/1970:00:00:29 +0000] boa: server built Apr 7
2011 at 18:02:48.
[01/Jan/1970:00:00:29 +0000] boa: starting server pid=915, port 80
说明为什么使用 上面的命令呢??
在建立文件系统是,etc/rc.d/init/httpd 的内容是:
它是 boa 的一个代理,可以说是一个快捷方式吧
- #!/bin/sh
-
-
base=boa
-
-
# See how we were called.
-
case "$1" in
-
start)
-
/sbin/$base
-
;;
-
stop)
-
pid=`/bin/pidof $base`
-
if [ -n "$pid" ]; then
-
kill -9 $pid
-
fi
-
;;
-
esac
-
-
exit 0
2.当我输入 192.168.1.6时,服务器提示信息,表示数据发送,但是显示 No such file or directory 因为我没有这些图像和文本在本地服务器上,
- [root@yuweixian /]# [01/Jan/1970:00:00:44 +0000] request from 192.168.1.7
-
-
"GET /source/script_cookie.js HTTP/1.1" ("/web/source/script_cookie.js"):
-
-
document open: No such file or directory
-
[01/Jan/1970:00:00:44 +0000] request from 192.168.1.7 "GET
-
-
/source/script_common.js HTTP/1.1" ("/web/source/script_common.js"): document
-
-
open: No such file or directory
-
[01/Jan/1970:00:00:44 +0000] request from 192.168.1.7 "GET
-
-
/source/script_menu.js HTTP/1.1" ("/web/source/script_menu.js"): document
-
-
open: No such file or directory
-
[01/Jan/1970:00:00:44 +0000] request from 192.168.1.7 "GET
-
-
/source/script_ajax.js HTTP/1.1" ("/web/source/script_ajax.js"): document
-
-
open: No such file or directory
-
[01/Jan/1970:00:00:44 +0000] request from 192.168.1.7 "GET
-
-
/source/script_face.js HTTP/1.1" ("/web/source/script_face.js"): document
-
-
open: No such file or directory
阅读(2568) | 评论(0) | 转发(0) |