毕 业 设 计 论 文
专业班级: 计算机科学与技术·计本061 学生姓名: 唐宇松 指导教师: 朱克敌
密级:内部
基于Apache源代码的Web应用服
务器的体系结构分析
Analysing the architecture of the Web application server based on
Apache source code
系别名称: 信息工程系
专业班级: 计算机科学与技术·计本061 学生姓名: 唐宇松 学 号: 2006403121 指导教师: 朱克敌
沈阳工程学院毕业论文 摘 要
摘 要
如果说没有Apache就没有Intemet可能有些夸张,但至少可以说没有Apache,互联网就不会发展得这么快。根据互联网研究公司NetCraft的统计,多年来Apache一直稳居Web服务器市场的头把交椅,至今仍占据超过50%的市场份额。就整个互联网来说,Apache仍然是最重要的软件之一。
本论文通过分析Apache服务器体系结构中层次结构和主程序main.c文件源代码,了解Apache服务器运行过程及其运行原理。然后主要分析了Apache服务器中主要的三个重要运行模块及其代码:用于模块加载的三个主要模块,用于指令的指令处理模块,最后是挂钩处理的五个重要组成部分。通过分析它们,为了给未来希望编写第三方模块的人提供借鉴和相关参考。
关键词 Apache服务器,模块加载,指令处理模块,挂钩
- I -
沈阳工程学院毕业论文 Abstract
Abstract
If there is no Apache would not Intemet may be some exaggeration, but at least you can say there is no Apache, the Internet would not have developed so fast. According to Internet research firm NetCraft statistics, over the years has been one of Apache Web server market, the top spot, still holds more than 50% market share. For the whole Internet, Apache still is one of the most important software.
This dissertation analyzes the hierarchy of Apache server and the main program main.c source code file. Learn operating process and principle of the Apache server. Then the main analysis of the main Apache server to run the three major modules and the code: The three main modules of the load module, the command processing module of command, the five important part of the hook. By analyzing them, in order to the people who hope to write the third-party modules in the future provide reference and related reference.
Keywords Apache server, load module, command processing module, hook
- II -
沈阳工程学院毕业论文 目 录
目 录
摘 要 ............................................................................................................................ I Abstract ......................................................................................................................... II 第1章 概 述 ............................................................................................................ 1
1.1 课题研究的意义 ............................................................................................ 1 1.2 Apache功能 .................................................................................................. 1
1.2.1 Apache虚拟主机 ................................................................................ 1 1.2.2 持续连接 .............................................................................................. 1 1.2.3 缓存 ...................................................................................................... 2 1.2.4 访问控制和安全 .................................................................................. 2
第2章 课题研究相关技术 ........................................................................................ 3
2.1 HTTP协议及HTTP服务器的工作原理 ..................................................... 3
2.1.1 HTTP协议简介 ................................................................................... 3 2.1.2 HTTP服务器 ....................................................................................... 3 2.2 MVC三层体系结构以及各个层次之间的依赖关系 ................................. 4
2.2.1 MVC三层体系结构 ........................................................................... 4 2.2.2 MVC三层体系结构之间的依赖关系 ............................................... 4
第3章 Apache体系结构 .......................................................................................... 5
3.1 Apache目录 .................................................................................................. 5
3.2 Apache层次结构 .......................................................................................... 6
3.2.1 操作系统支持层 .................................................................................. 7 3.2.2 可移植运行库层 .................................................................................. 7 3.2.3 核心功能层 .......................................................................................... 7 3.2.4 可选功能层 .......................................................................................... 7 3.3 Apache核心功能层 ...................................................................................... 8
3.3.1 核心与可选模块的关系 ...................................................................... 8 3.3.2 核心组件 .............................................................................................. 8 3.4 Apache运行流程 .......................................................................................... 9
3.4.1 Apache启动过程 ................................................................................ 9 3.4.2 HTTP连接处理 ................................................................................... 9 3.4.3 请求报文读取 ...................................................................................... 9 3.4.4 请求处理 ............................................................................................ 10 3.4.5 内容生成 ............................................................................................ 11 3.5 主程序main ................................................................................................. 11
3.5.1 主程序概要 ........................................................................................ 11 3.5.2 主程序细节 ........................................................................................ 11
第4章 Apache模块化体系结构 ............................................................................ 20
4.1 Apache模块概述 ........................................................................................ 20
- III -