Apache API Notes Robert S. Thau (Presented by Justin Erenkrantz)
Introduction Allow third-parties to extend product Expose as much as possible C Modules –Provides hooks and handlers –May execute arbitrary code –May be controlled by configuration directives
Approach Hooks –Run at well-defined stages of execution –Run for all requests Handlers –Responsible for serving content –Only run for specific requests –May accept or decline request
Apache 1.3 Hook Stages Translate URI->File Check user Auth check Access check Type check Fixer Upper Logger Header Parser Child Init Child Exit Post Read Request
Apache 1.3 Data Model Memory Pools –No malloc()/free() –Used to optimize memory allocation –Cleanups request_rec, conn_rec –Core data structures –Access to headers, file structure
Strength and Weaknesses Proved worth Lots of functionality never envisioned Fairly robust Tied to HTTP Tied to files Inability to layer No ability to thread
Observations Apache HTTP Server 2.0 addresses some of these concerns –Filters and Bucket Brigades –Threaded processing –Multi-protocol support Requires rewrite of modules