Configs2026年7月5日·1 分钟阅读

Apache HTTP Server — The Original Open Source Web Server

The most widely deployed web server in internet history. Apache HTTPD serves static and dynamic content, handles reverse proxying, and supports hundreds of modules for authentication, caching, and URL rewriting.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Apache HTTPD
直接安装命令
npx -y tokrepo@latest install 2261a58c-782c-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Apache HTTP Server (httpd) is the web server that helped define the modern internet. First released in 1995, it remains one of the most widely deployed HTTP servers, powering millions of websites with a battle-tested architecture and an extensive module ecosystem.

What Apache HTTPD Does

  • Serves static files, CGI scripts, and proxied dynamic content over HTTP/1.1 and HTTP/2
  • Acts as a reverse proxy and load balancer for backend application servers via mod_proxy
  • Provides URL rewriting and redirection through the powerful mod_rewrite engine
  • Handles TLS termination with mod_ssl for HTTPS, including ACME certificate automation via third-party modules
  • Supports virtual hosting to serve multiple domains from a single server instance

Architecture Overview

Apache HTTPD uses a modular, multi-processing architecture. The core handles connection management and delegates functionality to loadable modules (DSOs). Three Multi-Processing Modules (MPMs) are available: prefork (process-per-connection), worker (hybrid threads and processes), and event (async event-driven). Configuration is declarative, using httpd.conf and .htaccess files with a directive-based syntax. The module API allows extending nearly every aspect of request processing.

Self-Hosting & Configuration

  • Install from your distribution's package manager or compile from source for custom module selection
  • Edit /etc/apache2/apache2.conf (Debian) or /etc/httpd/conf/httpd.conf (RHEL) for global settings
  • Use the event MPM for modern workloads; it handles keep-alive connections without blocking threads
  • Enable mod_ssl and configure certificates for HTTPS; pair with certbot for automated Let's Encrypt renewals
  • Place .htaccess files in document roots for per-directory overrides (disable AllowOverride for better performance)

Key Features

  • Over 80 official modules covering authentication, caching, compression, proxying, and security
  • .htaccess files allow per-directory configuration without restarting the server
  • Mature mod_rewrite engine provides regex-based URL manipulation used by most CMS platforms
  • Virtual host support serves unlimited domains from a single instance with name-based or IP-based routing
  • Proven stability under extreme load, with decades of production hardening

Comparison with Similar Tools

  • Nginx — event-driven reverse proxy with a smaller footprint and simpler config syntax; Apache offers richer per-directory overrides via .htaccess
  • Caddy — automatic HTTPS and simpler configuration; Apache provides a larger module ecosystem and deeper customization
  • LiteSpeed — drop-in Apache replacement with better performance for PHP; Apache is fully open source with no commercial tiers
  • Traefik — cloud-native reverse proxy with automatic service discovery; Apache is more traditional but more broadly deployed

FAQ

Q: Is Apache HTTPD still relevant compared to Nginx? A: Yes. Apache powers a large share of the web, especially where .htaccess support or specific modules (like mod_rewrite for WordPress) are needed.

Q: Which MPM should I use? A: Use the event MPM for most modern deployments. It handles thousands of concurrent connections efficiently using an async event loop.

Q: Can Apache act as a reverse proxy? A: Yes. Enable mod_proxy and mod_proxy_http to forward requests to backend application servers like Node.js, Python, or Java.

Q: How do I enable HTTPS? A: Enable mod_ssl, configure your certificate and key paths in a VirtualHost block, and optionally use certbot to automate certificate renewal.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产