目录
第一章 为何使用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.youkuaiyun.com/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