module AP_MODULE_DECLARE_DATA mymodule_module = STANDARD20_MODULE_STUFF, NULL, // create per-directory config NULL, // merge per-directory config NULL, // create per-server config NULL, // merge per-server config mymodule_cmds, // command table (config directives) mymodule_register_hooks // Register hook functions ;
static void mymodule_register_hooks(apr_pool_t *p) // Run after the URI is translated to a filename ap_hook_translate_name(mymodule_translate, NULL, NULL, APR_HOOK_MIDDLE); // Run at the very end of response generation ap_hook_log_transaction(mymodule_log, NULL, NULL, APR_HOOK_LAST); apache2 code
Date: 2023-10-27 (Revised for general context) Subject: Architecture, Module API, and Build System of Apache 2.x 1. Executive Summary The Apache HTTP Server (Apache 2) is an open-source, cross-platform web server maintained by the Apache Software Foundation. Its codebase is written primarily in C and is renowned for its high modularity, portability, and stability. The shift from Apache 1.3 to Apache 2.0 introduced a radical new architecture known as the Multi-Processing Module (MPM) , which decoupled the networking and process management from the request processing logic. 2. Source Code Structure The Apache 2 codebase is organized into several top-level directories within the Subversion (SVN) or Git mirror repository. The shift from Apache 1