开发平台:ubuntu 8.04
目标平台:s3c2410
开发工具:arm交叉工具链版本3.4.5
boa版本:boa-0.94.13.tar.gz
一、下载源码,生成makefile
1.下载源码:
2.拷贝到/opt目录下
3.解压tar zxvf boa-0.94.13.tar.tar
4.cd boa-0.94.13/src
5. ./configure
二、编译前,修改文件
1.修改makefile文件,找到cc=gcc和cpp=gcc -e,分别将其改为交叉编译器安装的路径:
cc=arm-softfloat-linux-gnu-gcc
cpp= arm-softfloat-linux-gnu-g++
保存退出。
2.修改编译方式:
ldflags = -g –static
注:使用静态编译可以让目标文件自动的包含所需要的
库文件,而动态编译需要手工拷贝库文件。
3.修改/src/defines.h文件:
#define server_root /etc/boa
4修改boa-0.94/src/ util.c文件
修改char *get_commonlog_time(void)函数。
time_offset = 0;
5.修改src/config.c:加current_uid=1
6.修改compat.h: 把第120行的
#define
timezone_offset(foo)foo##->tm_gmtoff
修改为:
#define
timezone_offset(foo)foo->tm_gmtoff
7.修改/src/boa.c,注释掉下面两行:
/* if (setuid(0) != -1) {
die(icky linux kernel bug!);
} */
/*if (passwdbuf == null) {
die(getpwuid);
}*/
8:config.c
/*if (!server_name) {
struct hostent *he;
char temp_name[100];
if (gethostname(temp_name, 100) == -1) {
perror(gethostname:);
exit(1);
}
he = gethostbyname(temp_name);
if (he == null) {
perror(gethostbyname:);
exit(1);
}
server_name = strdup(he->h_name);
if (server_name == null) {
perror(strdup:);
exit(1);
}
}*/
9. /src/log.c中的修改:注释掉:
/*if (dup2(error_log, stderr_fileno) == -1) {
die(unable to dup2 the error log);
} */
10.在boa.conf中的修改:
(1)servername的设置
修改#servername
为servername
注意:该项默认为未打开,执行boa会异常退出,提示“gethostbyname::no such file or directory”,所以必须打开。其它默认设置即可。
注意:以下是为改为下面这样的:
(2)user与group的修改:
user 0
group 0
(3)errorlog /var/log/boa/error_log
accesslog /var/log/boa/access_log
(4)documentroot /var/www
(5)directoryindex index.html
(6)keepalivemax 1000
keepalivetimeout 10
(7)mimetypes /etc/mime.types
(8)scriptalias /cgi-bin/ /var/www/cgi-bin/
三、编译并移植
1.编译boa
# make
# arm-softfloat-linux-gnu-strip boa
2,将mime.types文件复制目标板根文件系统/etc目录下
3。在开发板上
cd /etc
mkdir boa
把开发机上的(配置文件)boa.conf(编译结果)boadefines.h这3个文件拷贝到 开发板/etc/boa/下
4.在开发板上
cd /var
mkdirwww(这个文件夹内可以放网页)
mkdir /var/log/boa
四、 编写cgi脚本测试
1、编写helloworld.c程序
int main(void)
{
printf(content-type:text/htmlnn); //这句一定要加上
printf( hello,world.);
exit(0);
}
arm-softfloat-linux-gnu-gcc -o helloworld helloworld.c
2、浏览
将helloworld拷贝至/var/www/cgi-bin/下,浏览器输入开发板ip地址即可看到web信息。
了解一下好的TensorFlow框架中需要包含哪些内容
网络时钟安装及调试的详细说明
云计算已成企业组织数字化转型的动力
回顾国务院国资委邓志雄局长莅临星云视察
英特尔考虑成为Arm的锚定投资者,募资规模或达百亿
嵌入式web server boa在S3C2410上的编译移植步骤
恩智浦发布2016年第二季度财务报告
三菱FX系列PLC常用指令大全来了
唯一一款6G运存的手机为何会不受待见?360N5到底做错了什么?
S32K146的hard fault问题解决方案
隔离开关结构组成
骨传导耳机哪个好,骨传导耳机排行榜
中方对半导体材料出口管制是反击美日荷?外交部:不针对特定国家
抗干扰的接近传感器电路设计
Fairchild开发IntelliMAX负载开关显著延长电
肖特基二极管的用法
在智能插线板大行其道时,这款插座玩起了DIY
各类机械手的工作原理和功能特点
照相机电子快门控制电路原理图
优博终端RobanTrust OS软件发行版通过兼容性测评,加快面向八大行业商业化落地