Boa Webserver使用和部分源码学习(凭兴趣更新)

目录

第一章 为何使用Boa

第二章 Boa结构

第三章 Boa源码目录介绍

第四章 Boa部分重要源码介绍

 

一、为何使用Boa

Boa是嵌入式系统常用的轻量级webserver,是一个小巧高效的web服务器,其可执行代码只有大约60KB左右。是一个运行于unix或linux下的,支持CGI的、适合于嵌入式系统的单任务的http服务器。更重要的是源代码开放、性能高。由于它是一个单任务的Web服务器,只能一次完成用户的请求,而不会fork出新的进程来处理并发的链接请求。但是Boa支持Cgi,能够为Cgi程序fork出一个进程来执行相应的客户请求。

参考:http://www.boa.org/documentation/boa-1.html

二、Boa结构

 

参考:https://blog.csdn.net/u014530704/article/details/72822775

三、源码目录介绍

|-- apmib            <----- apmib library   apmib库
|--cgi                   <------用来验证cgi是否连接的测试代码
| --contrib        <----- boa自带吹水文件,里面记述的是吹水人员的威水事
|-- defconfig        <----- default apmib configuration 默认apmib配置
|--docs               <------boa自带
|-- example          <----boa自带,内有boa.conf,该文件是Boa的唯一配置文件。该文件中的指令在DIRECTIVES部分中定义。
|--extras              <----boa自带额外小程序,例如字符串过滤等。
|-- html             <----- HTML pages and graphics files html页面和图形文件
|-- src              <----- source code of Boa web server  Boa web服务器源代码,自带
|-- system           <----- source code for system and network init  系统和网络初始化的源代码
|-- tools            <----- tools on x86  x86上的工具
|-- utils            <----- flash utility  flash实用程序

以上根据版本有所区别,一般情况,boa.conf在根目录下,其他命名包都是厂商增加而为之。

四、Boa部分重要源码介绍

1.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 custom 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.3.2.6 2003/02/02 05:02:22 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
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值