# Apache HTTP 服务器

Apache HTTP 服务器（Apache HTTP Server），通常简称为 Apache，是由 Apache 软件基金会（Apache Software Foundation）开发的一款自由且开源的 Web 服务器，负责处理 HTTP 请求，通过模块化的流水线对请求进行处理，并可作为正向或反向代理使用。它始于 1995 年，最初是一组针对 NCSA HTTPd 服务器的补丁，后来成为 Apache 软件基金会的首个重大项目，而该基金会于 1999 年成立，很大程度上正是为了支持它。

| 关键事实 | 详情 |
|---|---|
| 首次公开发布 | 0.6.2 版，1995 年 4 月，基于 NCSA httpd 1.3 构建，并加入了已公布的缺陷修复与功能增强<sup>[1](https://d.apache.org/ABOUT_APACHE.html)</sup> |
| 1.0 版 | 1995 年 12 月 1 日发布；一年之内，Apache 便超越 NCSA，成为使用最广泛的 Web 服务器<sup>[2](https://apache.org/history/timeline.html)</sup> |
| 基金会 | Apache 软件基金会于 1999 年 6 月成立，并注册为美国 501(c)(3) 非营利组织，以支持该 HTTP 服务器<sup>[2](https://apache.org/history/timeline.html)</sup><sup> • </sup><sup>[1](https://d.apache.org/ABOUT_APACHE.html)</sup> |
| 架构 | 请求处理沿一条钩子序列运行，从 URI 转换到内容生成与日志记录，模块可插入并重排过滤器<sup>[3](https://d.apache.org/docs/current/en/developer/request.html)</sup> |
| 多处理模块 | prefork、worker、event、mpm_winnt、mpm_netware 与 mpmt_os2；自 2.4.17 起提供基于 SO_REUSEPORT 的连接分配<sup>[4](https://d.apache.org/docs/current/en/mod/mpm_common.html)</sup> |
| 代理能力 | mod_proxy 支持正向与反向（网关）模式、负载均衡，以及自 2.4.47 起的 websocket 升级<sup>[5](https://d.apache.org/docs/current/mod/mod_proxy.html)</sup> |
| 当前版本 | 2.4.68 于 2026 年 6 月 8 日发布，修复了一个已列出的漏洞；2.4.69 为当前发行版本<sup>[6](https://d.apache.org/security/vulnerabilities_24.html)</sup><sup> • </sup><sup>[7](https://downloads.apache.org/httpd/)</sup> |

## 起源

Apache 的历史始于 NCSA HTTPd 项目，这是由美国[国家超级计算应用中心](https://www.edgepedia.org/zh/national-center-for-supercomputing-applications)（National Center for Supercomputing Applications）开发的 Web 服务器。1995 年 2 月，不到十二名软件工程师通过电子邮件共享针对 NCSA 服务器的代码补丁<sup>[8](https://cwiki.apache.org/confluence/download/attachments/158870538/8%20Aug%20-%20Open%20Source%20%26%20The%20Apache%20Way.pdf?api=v2)</sup>。该群体以 NCSA httpd 1.3 为基础，加入了他们能找到的全部已公布缺陷修复和有价值的增强功能，在自己的服务器上测试了结果，并于 1995 年 4 月完成了首次正式公开发布，即 0.6.2 版<sup>[1](https://d.apache.org/ABOUT_APACHE.html)</sup>。这个集体自称 Apache 小组（Apache Group）<sup>[1](https://d.apache.org/ABOUT_APACHE.html)</sup>。

后来的 0.8.8 版基于一个代号为“香巴拉”（Shambhala）的新服务器架构，由罗伯特·陶（Robert Thau）设计<sup>[2](https://apache.org/history/timeline.html)</sup>。Apache 1.0 于 1995 年 12 月 1 日随后发布，一年之内便超越 NCSA，成为使用最广泛的 Web 服务器<sup>[2](https://apache.org/history/timeline.html)</sup>。

## Apache 软件基金会的成立

Apache 小组的成员于 1999 年成立了 Apache 软件基金会，创建一个实体，为 Apache HTTP 服务器提供组织、法律和财务上的支持。<sup>[1](https://d.apache.org/ABOUT_APACHE.html)</sup> 基金会于 1999 年 6 月注册为美国 501(c)(3) 非营利组织<sup>[2](https://apache.org/history/timeline.html)</sup>。一个有据可查的动机是商业性的：IBM 希望以 Apache httpd 为基础开发自己的 Web 服务器，却不愿依赖一个模糊的、半官方的、被非正式地称为 Apache 小组的人群所开发的软件<sup>[9](https://news.apache.org/foundation/entry/our-founders-look-back-on)</sup>。正如一位创始人所说，在那个阶段，这个群体不过是在 NCSA 服务器之上的一堆补丁<sup>[9](https://news.apache.org/foundation/entry/our-founders-look-back-on)</sup>。

该 HTTP 服务器始终是基金会的旗舰项目，ASF 的历史项目将其描述为第一个、也可以说是最重要的软件项目，这款 Web 服务器常被简称为“Apache”<sup>[10](https://apache.org/history/)</sup>。

## 请求处理与模块

Apache HTTP 服务器 2.4 通过一条定义明确的钩子序列处理每个请求，涵盖从 URI 转换到内容生成与日志记录的完整路径<sup>[3](https://d.apache.org/docs/current/en/developer/request.html)</sup>。对内容进行转换的模块可以插入自己的过滤器并覆盖已有的过滤器，如果用户配置了更高级的过滤器而顺序有误，模块还可以调整过滤器的顺序<sup>[3](https://d.apache.org/docs/current/en/developer/request.html)</sup>。

**多处理模块。** 服务器的并发模型可通过多处理模块（Multi-Processing Modules，MPM）插拔替换。发行版附带 event、worker、prefork、mpm_winnt、mpm_netware 与 mpmt_os2<sup>[4](https://d.apache.org/docs/current/en/mod/mpm_common.html)</sup>。worker MPM 实现了一种混合的多线程多进程 Web 服务器<sup>[11](https://d.apache.org/docs/2.4/en/mod/)</sup>。文档指南按用途区分这些选择：需要极高可扩展性的站点可以使用 worker 或 event 这类线程化 MPM，而需要稳定性或与旧软件兼容的站点可以使用 prefork<sup>[12](https://archive.apache.org/dist/httpd/docs/httpd-docs-2.4.9.en.pdf)</sup>。自 2.4.17 版起，在内核支持 SO_REUSEPORT 套接字选项的情况下，新连接可以均匀分配到监听进程或线程的套接字上<sup>[4](https://d.apache.org/docs/current/en/mod/mpm_common.html)</sup>。

**代理。** mod_proxy 模块及相关模块实现了一个代理或网关，支持若干流行协议和若干负载均衡算法<sup>[5](https://d.apache.org/docs/current/mod/mod_proxy.html)</sup>。正向代理位于客户端与源服务器之间，需要客户端进行特殊配置；反向代理，或称网关，在客户端看来就是一个普通的 Web 服务器，由它决定将请求发往何处，用于暴露防火墙后的服务器、在后端服务器之间均衡负载、为较慢的后端提供缓存，或将多台服务器纳入同一个 URL 空间<sup>[5](https://d.apache.org/docs/current/mod/mod_proxy.html)</sup>。反向代理通过 ProxyPass 指令或 RewriteRule 的 [P] 标志启用，ProxyPassReverse 则调整重定向响应头中的 URL，以免客户端绕过代理<sup>[5](https://d.apache.org/docs/current/mod/mod_proxy.html)</sup>。ProxyPass 中的 websocket 升级支持自 2.4.47 版起提供<sup>[5](https://d.apache.org/docs/current/mod/mod_proxy.html)</sup>。

**URL 重写。** mod_rewrite 模块使用带条件和标志的规则重写 URL。主服务器配置中的规则在启动时编译一次，而 .htaccess 上下文中的 RewriteRule 指令则必须在每次请求该目录时重新编译<sup>[13](https://archive.apache.org/dist/httpd/docs/httpd-docs-2.4.25.en.pdf)</sup>。更一般地说，允许使用 .htaccess 文件会造成性能损失，无论这些文件是否被实际使用，因为每次对该目录的请求都会查阅该文件<sup>[13](https://archive.apache.org/dist/httpd/docs/httpd-docs-2.4.25.en.pdf)</sup>。

## 安全实践

Apache 软件基金会表示，它对消除针对该服务器的安全问题和拒绝服务攻击持积极立场<sup>[14](https://d.apache.org/security_report.html)</sup>。该项目发布了一个页面，列出 2.4 各发行版本中修复的所有安全漏洞，并指出为“-dev”版本显示的修复位于开发源码树中，尚待完整发布<sup>[6](https://d.apache.org/security/vulnerabilities_24.html)</sup>。近期的公告包括 2024 年 7 月 23 日公布的 CVE-2024-40725 和 CVE-2024-40898，CERT-EU 建议针对这些漏洞更新至 2.4.62 或更高版本<sup>[15](https://cert.europa.eu/publications/security-advisories/2024-073/)</sup>，以及一份 2025 年的公告，涵盖 2025 年 7 月 10 日 CHANGES_2.4.64 公告中的修复<sup>[16](https://www.cert.ssi.gouv.fr/avis/CERTFR-2025-AVI-0586/)</sup>。2026 年 6 月 8 日发布的 2.4.68 版修复了一个已列出的漏洞，建议用户升级至该版本<sup>[6](https://d.apache.org/security/vulnerabilities_24.html)</sup>。

## 在 Web 服务器中的地位

Netcraft Web 服务器调查自 1995 年起便追踪支撑互联网的技术，包括 Web 服务器市场份额<sup>[17](https://www.netcraft.com/resources/web-server-survey)</sup>。2025 年发表于《互联网与软件工程杂志》（Journal of Internet and Software Engineering）的一项性能研究指出，2024 年使用最广泛的十款 Web 服务器中有三款是 Apache、Nginx 和 Caddy<sup>[18](https://journal.ugm.ac.id/v3/JISE/article/download/15011/6731)</sup>。

## References

1. [About the Apache HTTP Server Project, The Apache HTTP Server Project](https://d.apache.org/ABOUT_APACHE.html)
2. [ASF History Project - Timeline, Apache Software Foundation](https://apache.org/history/timeline.html)
3. [Request Processing in the Apache HTTP Server 2.4, Apache HTTP Server Version 2.4 documentation](https://d.apache.org/docs/current/en/developer/request.html)
4. [mpm_common - Apache HTTP Server Version 2.4](https://d.apache.org/docs/current/en/mod/mpm_common.html)
5. [mod_proxy - Apache HTTP Server Version 2.4](https://d.apache.org/docs/current/mod/mod_proxy.html)
6. [Apache HTTP Server 2.4 vulnerabilities, The Apache HTTP Server Project](https://d.apache.org/security/vulnerabilities_24.html)
7. [Index of /httpd, downloads.apache.org](https://downloads.apache.org/httpd/)
8. [History - Started with Apache HTTP Web Server project, The Apache Way (ASF Confluence PDF)](https://cwiki.apache.org/confluence/download/attachments/158870538/8%20Aug%20-%20Open%20Source%20%26%20The%20Apache%20Way.pdf?api=v2)
9. [Our Founders look back on 20 Years of the ASF!, The ASF Blog](https://news.apache.org/foundation/entry/our-founders-look-back-on)
10. [ASF History, Apache Software Foundation](https://apache.org/history/)
11. [Module Index - Apache HTTP Server Version 2.4](https://d.apache.org/docs/2.4/en/mod/)
12. [Apache HTTP Server Documentation Version 2.4 (MPM overview)](https://archive.apache.org/dist/httpd/docs/httpd-docs-2.4.9.en.pdf)
13. [Apache HTTP Server Documentation Version 2.4 (.htaccess and mod_rewrite)](https://archive.apache.org/dist/httpd/docs/httpd-docs-2.4.25.en.pdf)
14. [Reporting Security Problems with Apache, The Apache HTTP Server Project](https://d.apache.org/security_report.html)
15. [CERT-EU Security Advisory 2024-073: Apache HTTP Server Critical Vulnerabilities](https://cert.europa.eu/publications/security-advisories/2024-073/)
16. [CERT-FR Avis CERTFR-2025-AVI-0586: Multiples vulnérabilités dans Apache HTTP Server](https://www.cert.ssi.gouv.fr/avis/CERTFR-2025-AVI-0586/)
17. [Netcraft Web Server Survey](https://www.netcraft.com/resources/web-server-survey)
18. [Journal of Internet and Software Engineering (JISE), Vol. 6, No. 2, November 2025](https://journal.ugm.ac.id/v3/JISE/article/download/15011/6731)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Named software products and platforms › Web servers and content platforms

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/apache-http-server

English original: https://www.edgepedia.org/apache-http-server
