Apache HTTP Server Version 2.3

Available Languages: en
This document describes changes to the Apache HTTPD API from version 2.2 to 2.4, that may be of interest to module/application developers and core hacks. At the time of writing, the 2.4 API is not finalised, and this document may serve to highlight points that call for further review.
API changes fall into two categories: APIs that are altogether new, and existing APIs that are expanded or changed. The latter are further divided into those where all changes are back-compatible (so existing modules can ignore them), and those that might require attention by maintainers. As with the transition from HTTPD 2.0 to 2.2, existing modules and applications will require recompiling and may call for some attention, but most should not require any substantial updating (although some may be able to take advantage of API changes to offer significant improvements).
For the purpose of this document, the API is split according
to the public header files. These headers are themselves the
reference documentation, and can be used to generate a browsable
HTML reference with make docs.
Introduces a new API to parse and evaluate boolean and algebraic expressions, including provision for a standard syntax and customised variants.
Introduces new API to enable apache child processes to serve different purposes.
ap_mpm_run is replaced by a new mpm hook.
Also ap_graceful_stop_signalled is lost, and
ap_mpm_register_timed_callback is new.
In addition to the existing regexp wrapper, a new higher-level API
ap_rxplus is now provided. This provides the capability to
compile Perl-style expressions like s/regexp/replacement/flags
and to execute them against arbitrary strings. Support for regexp
backreference.
Introduces an API for modules to allocate and manage memory slots (normally) for shared memory.
API to manage a shared object cache.
common structures for heartbeat modules (should this be public API?)
When possible, registering all access control hooks (including authentication and authorization hooks) using AP_AUTH_INTERNAL_PER_CONF is recommended. If all modules' access control hooks are registered with this flag, then whenever the server handles an internal sub-request that matches the same set of access control configuration directives as the initial request (which is the common case), it can avoid invoking the access control hooks another time.
If your module requires the old behavior and must perform access control checks on every sub-request with a different URI from the initial request, even if that URI matches the same set of access control configuration directives, then use AP_AUTH_INTERNAL_PER_URI.
Introduces the new provider framework for authn and authz
Introduces a commit_entity() function to the cache provider interface, allowing atomic writes to cache. Add a cache_status() hook to report the cache decision. Remove all private structures and functions from the public mod_cache.h header file.
This introduces low-level APIs to send arbitrary headers, and exposes functions to handle HTTP OPTIONS and TRACE.
Changes the disk format of the disk cache to support atomic cache updates without locking. The device/inode pair of the body file is embedded in the header file, allowing confirmation that the header and body belong to one another.
The API for mod_request, to make input data
available to multiple application/handler modules where required,
and to parse HTML form data.
ap_get_scoreboard_worker is gratuitously made non-back-compatible as an alternative version is introduced. Additional proxy_balancer support. Child status stuff revamped.
Introduces a new API for managing HTTP Cookies.
I have yet to get a handle on this update.
A wrapper for APR proc and global mutexes in httpd.
NEW: ap_args_to_table
NEW: ap_recent_ctime_ex
In order to take advantage of per-module loglevel configuration, any
source file that calls the ap_log_* functions should declare
which module it belongs to. If the module's module_struct is called
foo_module, the following code can be used to remain
backward compatible with HTTPD 2.0 and 2.2:
#include <http_log.h>
#ifdef APLOG_USE_MODULE
APLOG_USE_MODULE(foo);
#endif
The number of parameters of the ap_log_* functions and the
definition of APLOG_MARK has changed. Normally, the change
is completely transparent. However, if a module implements wrapper
functions for ap_log_* and uses APLOG_MARK
when calling these wrappers, some adjustments are necessary.
The easiest way is for the module to define and use a different macro
that expands to the parameters required by the log wrapper functions.
APLOG_MARK should only be used when calling
ap_log_* without additional wrappers. In this way, the
code will remain compatible with HTTPD 2.0 and 2.2.
Available Languages: en