linux-2.6.32在mini2440开发板上移植(21)之WebServer服务器移植

嵌入式学习--arm开发板网页控制灯 学习要求:移植Webserver(Web服务器)到开发板。源代码可以到相关网站下载。(编写测试程序,例:通过cgi实现远程控制(模拟控制,如控制led1灯)。 开发板:友善之臂mini2440 解: 注意:以下的服务器端与客户端在同一局域网内 网页控制 (1)在ubuntu系统中,打开终端,使用命令“arm-linux-gcc 2_2_wangyekongzhi.c -o web_le... 阅读详情

编者:其实也就是构建个WebServer服务器,只不过这里是以boa+cgic来实现的

1、移植boa软件
所用的软件为boa-0.94.13.tar.gz
先进行解压到当前目录
#tar -zxvf  boa-0.94.13.tar.gz
cd /boa-0.94.13 /src
 #./configure
修改Makefile
修改31,32行
CC=arm-linux-gcc
CPP=arm-linux-g++ -E
修改当前目录下boa.c的225~227行,直接删除即可
原话为
if(setuid(0)!=-1){
DIE()
}

修改compat.h
120行
改为如下
#define TIME_OFFSET(foo) (foo)->tm_gmtoff
编译
#make
优化
#arm-linux-strip boa


2、移植cgic库
cgic205.tar.gz

解压当当前目录
修改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 /usr/local/lib
 cp cgic.h /usr/local/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

 

编译

#make

优化

#arm-linux-strip capture

 

配置webserver

在文件系统里面建立新目录/web,在/etc/建立boa目录

将刚才生成的boa和boa.conf配置文件分别拷贝到相应目录

#cp /boa  /sbin

#cp /boa.conf   /etc/boa

#vi boa.conf

下面红色的是修改过的内容

# Boa v0.94 configuration file
# File format has not changed from 0.93
# File format has changed little from 0.92
# version changes are noted in the comments
#
# The Boa configuration file is parsed with a lex/yacc or flex/bison
# generated parser.  If it reports an error, the line number will be
# provided; it should be easy to spot.  The syntax of each of these
# rules is very simple, and they can occur in any order.  Where possible
# these directives mimic those of NCSA httpd 1.3; I saw no reason to 
# introduce gratuitous differences.

# $Id: boa.conf,v 1.25 2002/03/22 04:33:09 jnelson Exp $

# The "ServerRoot" is not in this configuration file.  It can be compiled
# into the server (see defines.h) or specified on the command line with
# the -c option, for example:
#
# boa -c /usr/local/boa


# Port: The port Boa runs on.  The default port for http servers is 80.
# If it is less than 1024, the server must be started as root.

Port 80

# Listen: the Internet address to bind(2) to.  If you leave it out,
# it takes the behavior before 0.93.17.2, which is to bind to all
# addresses (INADDR_ANY).  You only get one "Listen" directive,
# if you want service on multiple IP addresses, you have three choices:
#    1. Run boa without a "Listen" directive
#       a. All addresses are treated the same; makes sense if the addresses
#          are localhost, ppp, and eth0.
#       b. Use the VirtualHost directive below to point requests to different
#          files.  Should be good for a very large number of addresses (web
#          hosting clients).
#    2. Run one copy of boa per IP address, each has its own configuration
#       with a "Listen" directive.  No big deal up to a few tens of addresses.
#       Nice separation between clients.
# The name you provide gets run through inet_aton(3), so you have to use dotted
# quad notation.  This configuration is too important to trust some DNS.

#Listen 192.68.0.5

#  User: The name or UID the server should run as.
# Group: The group name or GID the server should run as.

User root
Group root

# ServerAdmin: The email address where server problems should be sent.
# Note: this is not currently used, except as an environment variable
# for CGIs.

#ServerAdmin root@localhost

# ErrorLog: The location of the error log file. If this does not start
# with /, it is considered relative to the server root.
# Set to /dev/null if you don't want errors logged.
# If unset, defaults to /dev/stderr

ErrorLog /dev/console
# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
#  is somewhat experimental and might fail under heavy load.
# "Usual libc implementations of printf will stall the whole
#  process if the receiving end of a pipe stops reading."
#ErrorLog "|/usr/sbin/cronolog --symlink=/var/log/boa/error_log /var/log/boa/error-%Y%m%d.log"

# AccessLog: The location of the access log file. If this does not
# start with /, it is considered relative to the server root.
# Comment out or set to /dev/null (less effective) to disable 
# Access logging.

AccessLog /dev/null
# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
#  is somewhat experimental and might fail under heavy load.
# "Usual libc implementations of printf will stall the whole
#  process if the receiving end of a pipe stops reading."
#AccessLog  "|/usr/sbin/cronolog --symlink=/var/log/boa/access_log /var/log/boa/access-%Y%m%d.log"

# UseLocaltime: Logical switch.  Uncomment to use localtime 
# instead of UTC time
#UseLocaltime

# VerboseCGILogs: this is just a logical switch.
#  It simply notes the start and stop times of cgis in the error log
# Comment out to disable.

#VerboseCGILogs

# ServerName: the name of this server that should be sent back to 
# clients if different than that returned by gethostname + gethostbyname 

ServerName yellow

# VirtualHost: a logical switch.
# Comment out to disable.
# Given DocumentRoot /var/www, requests on interface 'A' or IP 'IP-A'
# become /var/www/IP-A.
# Example: http://localhost/ becomes /var/www/127.0.0.1
#
# Not used until version 0.93.17.2.  This "feature" also breaks commonlog
# output rules, it prepends the interface number to each access_log line.
# You are expected to fix that problem with a postprocessing script.

#VirtualHost 

# DocumentRoot: The root directory of the HTML documents.
# Comment out to disable server non user files.

DocumentRoot /web

# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is recieved.

#UserDir public_html

# DirectoryIndex: Name of the file to use as a pre-written HTML
# directory index.  Please MAKE AND USE THESE FILES.  On the
# fly creation of directory indexes can be _slow_.
# Comment out to always use DirectoryMaker

DirectoryIndex index.html

# DirectoryMaker: Name of program used to create a directory listing.
# Comment out to disable directory listings.  If both this and
# DirectoryIndex are commented out, accessing a directory will give
# an error (though accessing files in the directory are still ok).

#DirectoryMaker /usr/lib/boa/boa_indexer

# DirectoryCache: If DirectoryIndex doesn't exist, and DirectoryMaker
# has been commented out, the the on-the-fly indexing of Boa can be used
# to generate indexes of directories. Be warned that the output is 
# extremely minimal and can cause delays when slow disks are used.
# Note: The DirectoryCache must be writable by the same user/group that 
# Boa runs as.

# DirectoryCache /var/spool/boa/dircache

# KeepAliveMax: Number of KeepAlive requests to allow per connection
# Comment out, or set to 0 to disable keepalive processing

KeepAliveMax 1000

# KeepAliveTimeout: seconds to wait before keepalive connection times out

KeepAliveTimeout 10

# MimeTypes: This is the file that is used to generate mime type pairs
# and Content-Type fields for boa.
# Set to /dev/null if you do not want to load a mime types file.
# Do *not* comment out (better use AddType!)

MimeTypes /etc/mime.types

# DefaultType: MIME type used if the file extension is unknown, or there
# is no file extension.

DefaultType text/plain

# CGIPath: The value of the $PATH environment variable given to CGI progs.

CGIPath /bin:/usr/bin:/usr/local/bin:/usr/sbin:/sbin

# SinglePostLimit: The maximum allowable number of bytes in 
# a single POST.  Default is normally 1MB.

# AddType: adds types without editing mime.types
# Example: AddType type extension [extension ...]

# Uncomment the next line if you want .cgi files to execute from anywhere
# AddType application/x-httpd-cgi cgi

# Redirect, Alias, and ScriptAlias all have the same semantics -- they
# match the beginning of a request and take appropriate action.  Use
# Redirect for other servers, Alias for the same server, and ScriptAlias
# to enable directories for script execution.

# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Example: Redirect /bar http://elsewhere/feh/bar

# Aliases: Aliases one path to another.
# Example: Alias /path1/bar /path2/foo

#Alias /doc /usr/doc

# ScriptAlias: Maps a virtual path to a directory for serving scripts
# Example: ScriptAlias /htbin/ /www/htbin/

ScriptAlias /cgi-bin/ /web/cgi-bin


3、在、web下建立cgi-bin目录,然后将编译好的cgic库文件(capture和cgic)和测试文件cgicctest.cgi下载到/web/cgi-bin下

运行boa,然后再PC的浏览器中输入http://192.168.1.107/cgi-bin/cgictest.cgi 即可进行测试

4、我直接将TQ文件系统的web考了过去,测试正常运行。

【转载】移植多款轻量级 Web服务器到ARM-Linux系统 http://blog.chinaunix.net/u1/34474/showart_488114.html网络服务对于嵌入式Linux来说,已经是基本的内容了。对于简单的WEB服务,可以移植现成的开源软件。   现在使用于小型系统的轻量级WebServer主要有:lighttpd、thttpd、shttpd和boa等等。   早在07年5月份的时候,由于毕业设计的需要,我就移植过了Boa服务 阅读详情

相关推荐

《Linux操作系统-系统移植》第10章 WEB服务器移植到ARM开发板

开发环境: 主机:Ubuntu12.04 开发板:Exynos4412 10.1服务器移植 第一步:boa的拷贝解压 官网地址:www.boa.org 使用共享文件夹的方式或者使用ssh等软件拷贝到Ubuntu系统中某个路径下解压: $tar -vxf boa-0.94.13.tar.gz $cd boa-0.94.13 第二步:boa生成Makefile编译文件 $cd src 编译配置: $...

不问归期的博客 1299

rtthread 移植 webserver

开发环境:野火的stm32f407,rt-thread studio的版本是: 2.2.6,stm32f4的资源包为0.2.2,rt-thread版本为4.0.3。 以RT-Thread中Lan8720和lwip协议栈的使用文章创建的工程为基础。lwip组件中开启使能网络接口设备功能,为了使用ifconfig指令。 在rtthread中想使用webserver,第一种方法可以...

weixin_46158019的博客 1478

著名的linux嵌入式系统的WebServer源代码,支持ASP脚本

从网上辛苦搜集的。。。关于LINUX嵌入式网络服务器的设计源代码

如何用ESP32创建webserver服务

面是一个使用Arduino IDE设置基本Web服务器的示例。这个示例会利用ESP8266或ESP32开发板,因为它们有内置的Wi-Fi功能,可以轻松创建Web服务器。

qq_16049057的博客 907

嵌入式系统/ARM技术中的嵌入式WebServer技术及其实现

摘要:讨论基于TCP/IP协议栈,利用8位单片机构建嵌入式WebServer的具体技术及相关实现方案;给出系统硬件原理框图和有关软件实现的代码框架结构。     关键词:WebServer TCP/IP协议栈 套接字 引 言   利用8位微控制器通过ISP(Internet服务供应商),在不需要使用PC机或高档单片机的情况下接入互联网。随着嵌入式系统的迅猛发展和IA(信息电器)的出现,该应用系统正逐步取代传统的以PC为中心的应用,成为未来Internet发展中的主力军;将会广泛应用于智能家居系统、工业智能化从站系统、LED网络控制显示屏系统、网络安全加密系统等各个方面。   利用单片

搭建Web服务的嵌入式Web Server

提出了一种新的搭建嵌入式Web Server的思路:将Web Server从嵌入式设备中搬运到运算能力更强的PC上,通过PHP+HTML实现服务器功能,而嵌入式设备通过Web请求与服务器互通信息。

将WebServer Boa移植到ARM上

一、在Boa的官网上下载Boa 网址:www.boa.ort 二、拷贝到虚拟机的共享目录下、解压 tar zxf boa-0.94.13.tar.gz 三、进入src文件夹,进行对代码的修改 1.打开compat.h 将 define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff 修改为: #define TIMEZONE_OFFSET(foo) foo...

遥望盼望,能像清风陪伴她飘去 668

EEGLAB合辑 | 第一节 往EEGLAB导入数据

1、学习Matlab EEGLAB图形界面建立在强大的Matlab脚本语言之上。要使用EEGLAB构建宏命令和执行自定义和自动化处理的全部功能,就需要能够在Matlab中操纵EEGLAB数据结构。由于时间限制,这个wiki没有提供关于Matlab脚本语言的介绍。相反,用户需要在开始研究之前熟悉Matlab。 2、安装EEGLAB和教程文件 首先下载包含教程数据集的EEGLAB(30MB),附下载地址。 (https://sccn.ucsd.edu/eeglab/downloadtoolbox.php) 解压

nvsirgn的博客 5134

三种嵌入式web服务器(Boa / lighttpd / shttpd)的 linux移植笔记

在开发板的 /var/www(由-root指定的根目录)放入测试网页:index.html在HOST的浏览器中输入开发板地址,测试通过!CGI测试在 /var/www (由-root指定的根目录)放入测试 CGI 程序:helloworldCGI.cgi在流览器中输入(开发板地址)192.168.1.2.cgi,测试通过!

mianhuantang848989的专栏 1997

三轴云台稳定控制算法优化实战:从PID到模糊自适应

本文深入探讨了三轴云台稳定控制算法的优化实践,从经典PID控制到模糊自适应算法的进阶应用。通过实战案例和代码示例,详细解析了PID调参技巧、模糊控制实现及多传感器数据融合方法,帮助工程师在复杂环境下提升云台抗干扰能力和响应速度,特别适用于无人机航拍等场景。

green的博客 910

大华/华睿工业相机(摄像头)链接电脑,并用OpenCV打开

睿科是大华旗下机器视觉子公司,现在工业相机一般是华睿在产,要下载驱动程序,要到华睿官网哪里下载。由于我的电脑没有摄像头,所以摄像头序列化为0,电脑的第一个摄像头默认为0,序列号是0,1,2,3……,你是什么接口连接的就选择什么, 建议直接全选。我这里选择第二个,下载后点击安装,的你要点击识别右侧设置,设置。这个过程很简单,故不赘述。打开你的设备会在右边显示。

qq_48050838的博客 1万+

快速学会web Server的裁剪移植

前几次给大家讲过freeRTOS的移植,不管是在我们移植好的,还是KSDK移植好的BSP里都有server的演示程序,KSDK里面使用lwip开源TCP/IP协议栈,今天...

wgp2hpp的博客 198

学习十八-UJA107xA简介及移植-0

目录 1、UJA107xA系列手册 1、介绍 2.2.1 BAT引脚功能 2.4.1 V1、V2稳压器 2.5.1 CAN收发器 3.1 Startup Operation 3.2 Normal Operation 5.1 Attached Files 5.2 NXP UJA107xA Example Software 6、main() 1、UJA107xA系列手册 看完手册关于使用还是没有头绪的,只是想SPI发送指令将V2驱动起来,进而驱动起来CAN收...

m0_56344230的博客 1706

boa移植

一、boa下载和安装: 1、修改编译安装文件: 1)在www.boa.org下载boa-0.94.13.tar.gz 并解压 2)在src目录下运行./configure生成Makefile。 3)生成Makefile文件,修改 CC = arm-linux-gcc CPP = arm-linux-gcc–E 2、修改boa.c源文件 将boa...

weixin_33738578的博客 543

AutoSar标准官网下载

AutoSar文档下载和文档命名格式。。。

m0_56208280的博客 3521

【SAP GUI 脚本 VBA】实战:构建Excel驱动的SAP自动化操作平台

本文详细介绍了如何利用VBA和SAP GUI脚本构建Excel驱动的SAP自动化操作平台,实现高频事务码的标准化封装和批量处理。通过实战案例展示物料主数据查询(MM03)、会计凭证修改(FB02)等场景的自动化实现,帮助用户提升10倍+操作效率,同时确保数据可追溯性和操作安全性。

weixin_33748818的博客 504

嵌入式linux最简单webserver

现在智能家居越來越多了,好多设备都可以用手机控制,而手机通常又通过wifi网络与设备交互! 特点是实时性要求不高,而且都是随时进行的,所以很想访问web页面,所以http方式很适合 以下是linux简单web源码,可以放入到嵌入式设备,通过web或者app可以控制和查询硬件信息,比如 书梅派 #include #include #include // socket #include

zmy12007的专栏 7180

selenium绕过检测,规避检测

现在不少大网站有对selenium采取了监测机制。比如正常情况下我们用浏览器访问淘宝等网站的 window.navigator.webdriver的值为 undefined或者为false。而使用selenium访问则该值为true。那么如何解决这个问题呢?我们正常浏览器登录查看,window.navigator.webdriver的值为false我们通过selenium打开的网页,测试,可见window.navigator.webdriver的值为true。

景天科技苑 1万+

开发板搭建简单的Web服务器

使用讯为4412开发板搭建简单的Web服务器 讯为开发板学习笔记

Wanggj的博客 2919

全球SAR卫星大盘点与回波数据处理专栏目录

本专栏将详细介绍各国各地区的SAR卫星的特点和性能,以及SAR回波数据的处理方法和技巧。主要介绍民用和商用SAR卫星,帮助你了解商业SAR卫星的最新动态和技术,MATLAB代码将全部开源。以下是专栏目录,持续更新中。

3161

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

【教程】移植web server到Ubuntu就是这么简单!

Ubuntu:Ubuntu9.10   目的:移植web server到Ubuntu   window下载thttpd,地址:http://www.acme.com/software/thttpd/ 1.上传thttpd到ubuntu,解压,配置,安装 $ tar zxf thttpd-2.27.tar.gz $ cd thttpd-2.27/ $ ./configure

韦东山嵌入式专栏 1869

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

嵌入式linux开发板web服务器搭建1——Boa移植

嵌入式linux开发板web服务器Boa移植笔记 环境 Ubuntu10.04.4 boa-0.94.13 主要步骤 主要参考https://wenku.baidu.com/view/8d5dd954f01dc281e53af08f.html和https://blog.csdn.net/lyiya/article/details/50865947两篇博客的步骤。 从http://www.boa....

积跬步以至千里 3345

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

cgicc boa 成功移植 arm

使用以下命令能使成功安装cgicc库 sudo tar xvf cgicc-3.2.19.tar.gz cd cgicc-3.2.19/ sudo ./configure --prefix=/usr/local/cgicc-3.2.19 --host=arm-none-linux-gnueabi CXX=/usr/local/arm_linux_4.8/bin/arm-linux-g++ sudo make sudo make install cd /usr/local/cgicc-3.2.19/ fil

uyihjigthgh的博客 291

linux下的webserver BOA及CGIC库的使用指南

linux下的webserver BOA及CGIC库的使用指南(转帖) 我把网页挂载到nfs下面的文件中(需要新建一个文件www),不过这样很方便! 安装过程 ========================================================== 1)在www.boa.org下载boa-...

weixin_33995481的博客 377

linux-2.6.32在mini2440开发板上移植(7)之修改linux开机logo

修改Linux LOGO 编者:linux的开机默认logo是一只可爱的小企鹅。这里我们可以把它换成我们自己喜爱的图片,只要将linux-2.6.32.2/drivers/video/logo/linux_logo_clut224.ppm替换成自己的图片即可。方法很简单,照着操作基本就没问题。以下按照手册介绍两种方法。注意在进行图片的转换时候,一定要先注意图片的大小,要和使用的液晶屏的大小匹配。

铸剑娃的专栏 4614
上一篇: linux-2.6.32在mini2440开发板上移植(22)之qtopia4.4.3手机版移植(english version)
下一篇: linux-2.6.32在mini2440开发板上移植(6)之W35型LCD驱动移植
ssdsafsdsd
博客等级 码龄15年 154粉丝 94原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值