new_api_2_4.html.en revision ac082aefa89416cbdc9a1836eaf3bed9698201c8
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq<?xml version="1.0" encoding="ISO-8859-1"?>
78cd48acd325773619d78ac0d7263a99a8922faend<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd This file is generated from xml source: DO NOT EDIT
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding -->
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<title>API Changes in Apache HTTP Server 2.4 since 2.2 - Apache HTTP Server</title>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<script src="/style/scripts/prettify.js" type="text/javascript">
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd</script>
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<link href="/images/favicon.ico" rel="shortcut icon" /></head>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<body id="manual-page"><div id="page-header">
7708bd70088b64148d7d78fd84ede43ced63c713minfrin<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
7708bd70088b64148d7d78fd84ede43ced63c713minfrin<p class="apache">Apache HTTP Server Version 2.5</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<img alt="" src="/images/feather.gif" /></div>
36a72c96fc2dda27eadbae8a108fa428cc1419c1wrowe<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<div id="path">
1723d9ccdd3b647f5b7bae44cab9ab3eca7a4874dougm<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a></div><div id="page-content"><div id="preamble"><h1>API Changes in Apache HTTP Server 2.4 since 2.2</h1>
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe<div class="toplang">
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe<p><span>Available Languages: </span><a href="/en/developer/new_api_2_4.html" title="English">&nbsp;en&nbsp;</a></p>
70535d6421eb979ac79d8f49d31cd94d75dd8b2fjorton</div>
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe <p>This document describes changes to the Apache HTTPD API from
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe version 2.2 to 2.4, that may be of interest to module/application
2555a6b5da21d61804f47084d8fcc98eb4acbc42wrowe developers and core hacks. As of the first GA release of the
1723d9ccdd3b647f5b7bae44cab9ab3eca7a4874dougm 2.4 branch API compatibility is preserved for the life of the
e9501b71b8a1e76384cb010b1e41e76a1e47aacctrawick 2.4 branch. (The
e9501b71b8a1e76384cb010b1e41e76a1e47aacctrawick <a href="http://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x/VERSIONING">VERSIONING</a>
e9501b71b8a1e76384cb010b1e41e76a1e47aacctrawick description for the 2.4 release provides more information about API
6335eb31f0f0ed54628a04ed32946360b8b77684minfrin compatibility.)</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <p>API changes fall into two categories: APIs that are altogether new,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding and existing APIs that are expanded or changed. The latter are
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding further divided into those where all changes are backwards-compatible
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe (so existing modules can ignore them), and those that might
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe require attention by maintainers. As with the transition from
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe HTTPD 2.0 to 2.2, existing modules and applications will require
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe recompiling and may call for some attention, but most should not
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding require any substantial updating (although some may be able to
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding take advantage of API changes to offer significant improvements).</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <p>For the purpose of this document, the API is split according
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding to the public header files. These headers are themselves the
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding reference documentation, and can be used to generate a browsable
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding HTML reference with <code>make docs</code>.</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding</div>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#api_changes">Changed APIs</a></li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<li><img alt="" src="/images/down.gif" /> <a href="#upgrading">Specific information on upgrading modules from 2.2</a></li>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
a812b025d139f465a31c76fc02ed162ed5271b03nd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a812b025d139f465a31c76fc02ed162ed5271b03nd<div class="section">
a812b025d139f465a31c76fc02ed162ed5271b03nd<h2><a name="api_changes" id="api_changes">Changed APIs</a></h2>
a812b025d139f465a31c76fc02ed162ed5271b03nd
a812b025d139f465a31c76fc02ed162ed5271b03nd
a812b025d139f465a31c76fc02ed162ed5271b03nd <h3><a name="ap_expr" id="ap_expr">ap_expr (NEW!)</a></h3>
a812b025d139f465a31c76fc02ed162ed5271b03nd
a812b025d139f465a31c76fc02ed162ed5271b03nd <p>Introduces a new API to parse and evaluate boolean and algebraic
a812b025d139f465a31c76fc02ed162ed5271b03nd expressions, including provision for a standard syntax and
a812b025d139f465a31c76fc02ed162ed5271b03nd customised variants.</p>
a812b025d139f465a31c76fc02ed162ed5271b03nd
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
a812b025d139f465a31c76fc02ed162ed5271b03nd <h3><a name="ap_listen" id="ap_listen">ap_listen (changed; backwards-compatible)</a></h3>
00211b036b78699ace57a6d800a52e6c2d57652fnd
00211b036b78699ace57a6d800a52e6c2d57652fnd <p>Introduces a new API to enable httpd child processes to serve
00211b036b78699ace57a6d800a52e6c2d57652fnd different purposes.</p>
a812b025d139f465a31c76fc02ed162ed5271b03nd
a812b025d139f465a31c76fc02ed162ed5271b03nd
a812b025d139f465a31c76fc02ed162ed5271b03nd <h3><a name="ap_mpm" id="ap_mpm">ap_mpm (changed)</a></h3>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <p><code>ap_mpm_run</code> is replaced by a new <code>mpm</code> hook.
a812b025d139f465a31c76fc02ed162ed5271b03nd Also <code>ap_graceful_stop_signalled</code> is lost, and
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <code>ap_mpm_register_timed_callback</code> is new.</p>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <h3><a name="ap_regex" id="ap_regex">ap_regex (changed)</a></h3>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <p>In addition to the existing regexp wrapper, a new higher-level API
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <code>ap_rxplus</code> is now provided. This provides the capability to
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe compile Perl-style expressions like <code>s/regexp/replacement/flags</code>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe and to execute them against arbitrary strings. Support for regexp
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe backreferences is also added.</p>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <h3><a name="ap_slotmem" id="ap_slotmem">ap_slotmem (NEW!)</a></h3>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <p>Introduces an API for modules to allocate and manage memory slots,
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe most commonly for shared memory.</p>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <h3><a name="ap_socache" id="ap_socache">ap_socache (NEW!)</a></h3>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <p>API to manage a shared object cache.</p>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <h3><a name="heartbeat" id="heartbeat">heartbeat (NEW!)</a></h3>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <p>common structures for heartbeat modules</p>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <h3><a name="ap_parse_htaccess" id="ap_parse_htaccess">ap_parse_htaccess (changed)</a></h3>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <p>The function signature for <code>ap_parse_htaccess</code> has been
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe changed. A <code>apr_table_t</code> of individual directives allowed
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe for override must now be passed (override remains).</p>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <h3><a name="http_config" id="http_config">http_config (changed)</a></h3>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <ul>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <li>Introduces per-module, per-directory loglevels, including macro wrappers.</li>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <li>New <code>AP_DECLARE_MODULE</code> macro to declare all modules.</li>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <li>New <code>APLOG_USE_MODULE</code> macro necessary for per-module loglevels in
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe multi-file modules.</li>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <li>New API to retain data across module unload/load</li>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <li>New <code>check_config</code> hook</li>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <li>New <code>ap_process_fnmatch_configs()</code> function to process wildcards</li>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <li>Change <code>ap_configfile_t</code>, <code>ap_cfg_getline()</code>,
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <code>ap_cfg_getc()</code> to return error codes, and add
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <code>ap_pcfg_strerror()</code> for retrieving an error description.</li>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <li>Any config directive permitted in ACCESS_CONF context must now
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe correctly handle being called from an .htaccess file via the new
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <code class="directive"><a href="/mod/core.html#allowoverridelist">AllowOverrideList</a></code> directive.
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe ap_check_cmd_context() accepts a new flag NOT_IN_HTACCESS to detect
9621e4c4056383e4a2b844b14687bae500b33a82wrowe this case.</li>
9621e4c4056383e4a2b844b14687bae500b33a82wrowe </ul>
9621e4c4056383e4a2b844b14687bae500b33a82wrowe
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe
9621e4c4056383e4a2b844b14687bae500b33a82wrowe <h3><a name="http_core" id="http_core">http_core (changed)</a></h3>
9621e4c4056383e4a2b844b14687bae500b33a82wrowe
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <ul>
4c67ef499845a08771e81254ce6eb2324a160bc7wrowe <li>REMOVED <code>ap_default_type</code>, <code>ap_requires</code>, all
4c67ef499845a08771e81254ce6eb2324a160bc7wrowe 2.2 authnz API</li>
4c67ef499845a08771e81254ce6eb2324a160bc7wrowe <li>Introduces Optional Functions for logio and authnz</li>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <li>New function <code>ap_get_server_name_for_url</code> to support IPv6
4c67ef499845a08771e81254ce6eb2324a160bc7wrowe literals.</li>
4c67ef499845a08771e81254ce6eb2324a160bc7wrowe <li>New function <code>ap_register_errorlog_handler</code> to register error log
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe format string handlers.</li>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <li>Arguments of <code>error_log</code> hook have changed. Declaration has moved to
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <code>http_core.h</code>.</li>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <li>New function <code>ap_state_query</code> to determine if the server is in the
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe initial configuration preflight phase or not. This is both easier to
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe use and more correct than the old method of creating a pool userdata
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe entry in the process pool.</li>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <li>New function <code>ap_get_conn_socket</code> to get the socket descriptor for a
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe connection. This should be used instead of accessing the core
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe connection config directly.</li>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe </ul>
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe
1dac466bcc84f8ebf410016dcf2a4cd4312e8611wrowe <h3><a name="httpd" id="httpd">httpd (changed)</a></h3>
41c38e78e8e5dc73544571cc2b749d40869e84fawrowe
41c38e78e8e5dc73544571cc2b749d40869e84fawrowe <ul>
41c38e78e8e5dc73544571cc2b749d40869e84fawrowe <li>Introduce per-directory, per-module loglevel</li>
41c38e78e8e5dc73544571cc2b749d40869e84fawrowe <li>New loglevels <code>APLOG_TRACEn</code></li>
41c38e78e8e5dc73544571cc2b749d40869e84fawrowe <li>Introduce errorlog ids for requests and connections</li>
41c38e78e8e5dc73544571cc2b749d40869e84fawrowe <li>Support for mod_request kept_body</li>
41c38e78e8e5dc73544571cc2b749d40869e84fawrowe <li>Support buffering filter data for async requests</li>
41c38e78e8e5dc73544571cc2b749d40869e84fawrowe <li>New <code>CONN_STATE</code> values</li>
41c38e78e8e5dc73544571cc2b749d40869e84fawrowe <li>Function changes: <code>ap_escape_html</code> updated;
4415d997ac73262e513c0a571bd5be4f609040bawrowe <code>ap_unescape_all</code>, <code>ap_escape_path_segment_buffer</code></li>
4415d997ac73262e513c0a571bd5be4f609040bawrowe <li>Modules that load other modules later than the <code>EXEC_ON_READ</code> config
4415d997ac73262e513c0a571bd5be4f609040bawrowe reading stage need to call <code>ap_reserve_module_slots()</code> or
4415d997ac73262e513c0a571bd5be4f609040bawrowe <code>ap_reserve_module_slots_directive()</code> in their
4415d997ac73262e513c0a571bd5be4f609040bawrowe <code>pre_config hook</code>.</li>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <li>The useragent IP address per request can now be tracked
5a5a6c22260854843c973e2ea9a14bec64362ab5wrowe independently of the client IP address of the connection, for
4415d997ac73262e513c0a571bd5be4f609040bawrowe support of deployments with load balancers.</li>
4415d997ac73262e513c0a571bd5be4f609040bawrowe </ul>
4415d997ac73262e513c0a571bd5be4f609040bawrowe
4415d997ac73262e513c0a571bd5be4f609040bawrowe
4415d997ac73262e513c0a571bd5be4f609040bawrowe <h3><a name="http_log" id="http_log">http_log (changed)</a></h3>
4415d997ac73262e513c0a571bd5be4f609040bawrowe
4415d997ac73262e513c0a571bd5be4f609040bawrowe <ul>
4415d997ac73262e513c0a571bd5be4f609040bawrowe <li>Introduce per-directory, per-module loglevel</li>
4415d997ac73262e513c0a571bd5be4f609040bawrowe <li>New loglevels <code>APLOG_TRACEn</code></li>
4415d997ac73262e513c0a571bd5be4f609040bawrowe <li><code>ap_log_*error</code> become macro wrappers (backwards-compatible if
4415d997ac73262e513c0a571bd5be4f609040bawrowe <code>APLOG_MARK</code> macro is used, except that is no longer possible to
4415d997ac73262e513c0a571bd5be4f609040bawrowe use <code>#ifdef</code> inside the argument list)</li>
4415d997ac73262e513c0a571bd5be4f609040bawrowe <li>piped logging revamped</li>
4415d997ac73262e513c0a571bd5be4f609040bawrowe <li><code>module_index</code> added to error_log hook</li>
4415d997ac73262e513c0a571bd5be4f609040bawrowe <li>new function: <code>ap_log_command_line</code></li>
4415d997ac73262e513c0a571bd5be4f609040bawrowe </ul>
4415d997ac73262e513c0a571bd5be4f609040bawrowe
4415d997ac73262e513c0a571bd5be4f609040bawrowe
4415d997ac73262e513c0a571bd5be4f609040bawrowe <h3><a name="http_request" id="http_request">http_request (changed)</a></h3>
4415d997ac73262e513c0a571bd5be4f609040bawrowe
4415d997ac73262e513c0a571bd5be4f609040bawrowe <ul>
4415d997ac73262e513c0a571bd5be4f609040bawrowe <li>New auth_internal API and auth_provider API</li>
4415d997ac73262e513c0a571bd5be4f609040bawrowe <li>New <code>EOR</code> bucket type</li>
4415d997ac73262e513c0a571bd5be4f609040bawrowe <li>New function <code>ap_process_async_request</code></li>
4415d997ac73262e513c0a571bd5be4f609040bawrowe <li>New flags <code>AP_AUTH_INTERNAL_PER_CONF</code> and
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <code>AP_AUTH_INTERNAL_PER_URI</code></li>
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe <li>New <code>access_checker_ex</code> hook to apply additional access control
38fd849bd99e2765ee633b6dc576b5f17acdc455wrowe and/or bypass authentication.</li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>New functions <code>ap_hook_check_access_ex</code>,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>ap_hook_check_access</code>, <code>ap_hook_check_authn</code>,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>ap_hook_check_authz</code> which accept
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>AP_AUTH_INTERNAL_PER_*</code> flags</li>
00211b036b78699ace57a6d800a52e6c2d57652fnd <li>DEPRECATED direct use of <code>ap_hook_access_checker</code>,
a812b025d139f465a31c76fc02ed162ed5271b03nd <code>access_checker_ex</code>, <code>ap_hook_check_user_id</code>,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>ap_hook_auth_checker</code></li>
00211b036b78699ace57a6d800a52e6c2d57652fnd </ul>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <p>When possible, registering all access control hooks (including
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard authentication and authorization hooks) using <code>AP_AUTH_INTERNAL_PER_CONF</code>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard is recommended. If all modules' access control hooks are registered
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard with this flag, then whenever the server handles an internal
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard sub-request that matches the same set of access control configuration
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard directives as the initial request (which is the common case), it can
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard avoid invoking the access control hooks another time.</p>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <p>If your module requires the old behavior and must perform access
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard control checks on every sub-request with a different URI from the
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard initial request, even if that URI matches the same set of access
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard control configuration directives, then use
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <code>AP_AUTH_INTERNAL_PER_URI</code>.</p>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <h3><a name="mod_auth" id="mod_auth">mod_auth (NEW!)</a></h3>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <p>Introduces the new provider framework for authn and authz</p>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
a812b025d139f465a31c76fc02ed162ed5271b03nd <h3><a name="mod_cache" id="mod_cache">mod_cache (changed)</a></h3>
a812b025d139f465a31c76fc02ed162ed5271b03nd
a812b025d139f465a31c76fc02ed162ed5271b03nd <p>Introduces a <code>commit_entity()</code> function to the cache provider
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq interface, allowing atomic writes to cache. Add a <code>cache_status()</code>
a812b025d139f465a31c76fc02ed162ed5271b03nd hook to report the cache decision. All private structures and functions were
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq removed.</p>
a812b025d139f465a31c76fc02ed162ed5271b03nd
a812b025d139f465a31c76fc02ed162ed5271b03nd
a812b025d139f465a31c76fc02ed162ed5271b03nd <h3><a name="mod_core" id="mod_core">mod_core (NEW!)</a></h3>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
a812b025d139f465a31c76fc02ed162ed5271b03nd <p>This introduces low-level APIs to send arbitrary headers,
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq and exposes functions to handle HTTP OPTIONS and TRACE.</p>
a812b025d139f465a31c76fc02ed162ed5271b03nd
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <h3><a name="mod_cache_disk" id="mod_cache_disk">mod_cache_disk (changed)</a></h3>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <p>Changes the disk format of the disk cache to support atomic cache
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding updates without locking. The device/inode pair of the body file is
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding embedded in the header file, allowing confirmation that the header
00211b036b78699ace57a6d800a52e6c2d57652fnd and body belong to one another.</p>
00211b036b78699ace57a6d800a52e6c2d57652fnd
00211b036b78699ace57a6d800a52e6c2d57652fnd
00211b036b78699ace57a6d800a52e6c2d57652fnd <h3><a name="mod_disk_cache" id="mod_disk_cache">mod_disk_cache (renamed)</a></h3>
00211b036b78699ace57a6d800a52e6c2d57652fnd
00211b036b78699ace57a6d800a52e6c2d57652fnd <p>The mod_disk_cache module has been renamed to mod_cache_disk in
00211b036b78699ace57a6d800a52e6c2d57652fnd order to be consistent with the naming of other modules within the
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding server.</p>
00211b036b78699ace57a6d800a52e6c2d57652fnd
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <h3><a name="mod_request" id="mod_request">mod_request (NEW!)</a></h3>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <p>The API for <code class="module"><a href="/mod/mod_request.html">mod_request</a></code>, to make input data
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding available to multiple application/handler modules where required,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding and to parse HTML form data.</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <h3><a name="mpm_common" id="mpm_common">mpm_common (changed)</a></h3>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <ul>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>REMOVES: <code>accept</code>, <code>lockfile</code>, <code>lock_mech</code>,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>set_scoreboard</code> (locking uses the new ap_mutex API)</li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>NEW API to drop privileges (delegates this platform-dependent
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding function to modules)</li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>NEW Hooks: <code>mpm_query</code>, <code>timed_callback</code>, and
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>get_name</code></li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <li>CHANGED interfaces: <code>monitor</code> hook,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>ap_reclaim_child_processes</code>,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>ap_relieve_child_processes</code></li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding </ul>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <h3><a name="scoreboard" id="scoreboard">scoreboard (changed)</a></h3>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <p><code>ap_get_scoreboard_worker</code> is made non-backwards-compatible
a812b025d139f465a31c76fc02ed162ed5271b03nd as an alternative version is introduced. Additional proxy_balancer
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq support. Child status stuff revamped.</p>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <h3><a name="util_cookies" id="util_cookies">util_cookies (NEW!)</a></h3>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
16d38ac65d7e54cd44eeda7b23f84ee68b35094ewrowe <p>Introduces a new API for managing HTTP Cookies.</p>
16d38ac65d7e54cd44eeda7b23f84ee68b35094ewrowe
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <h3><a name="util_ldap" id="util_ldap">util_ldap (changed)</a></h3>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <p><em>no description available</em></p>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <h3><a name="util_mutex" id="util_mutex">util_mutex (NEW!)</a></h3>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <p>A wrapper for APR proc and global mutexes in httpd, providing
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard common configuration for the underlying mechanism and location
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard of lock files.</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <h3><a name="util_script" id="util_script">util_script (changed)</a></h3>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <p>NEW: <code>ap_args_to_table</code></p>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <h3><a name="util_time" id="util_time">util_time (changed)</a></h3>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <p>NEW: <code>ap_recent_ctime_ex</code></p>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq<div class="section">
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq<h2><a name="upgrading" id="upgrading">Specific information on upgrading modules from 2.2</a></h2>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
a812b025d139f465a31c76fc02ed162ed5271b03nd <h3><a name="upgrading_logging" id="upgrading_logging">Logging</a></h3>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <p>In order to take advantage of per-module loglevel configuration, any
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq source file that calls the <code>ap_log_*</code> functions should declare
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq which module it belongs to. If the module's module_struct is called
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <code>foo_module</code>, the following code can be used to remain
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq backward compatible with HTTPD 2.0 and 2.2:</p>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <div class="example"><p><code>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding #include &lt;http_log.h&gt;<br />
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <br />
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding #ifdef APLOG_USE_MODULE<br />
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding APLOG_USE_MODULE(foo);<br />
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding #endif
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding </code></p></div>
134330b92fbc39045b7e56654f4c252fb7c53803nd <p>Note: This is absolutely required for C++-language modules. It
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding can be skipped for C-language modules, though that breaks
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding module-specific log level support for files without it.</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <p>The number of parameters of the <code>ap_log_*</code> functions and the
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding definition of <code>APLOG_MARK</code> has changed. Normally, the change
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding is completely transparent. However, changes are required if a
134330b92fbc39045b7e56654f4c252fb7c53803nd module uses <code>APLOG_MARK</code> as a parameter to its own functions
a812b025d139f465a31c76fc02ed162ed5271b03nd or if a module calls <code>ap_log_*</code> without passing
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>APLOG_MARK</code>. A module which uses wrappers
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard around <code>ap_log_*</code> typically uses both of these constructs.</p>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <p>The easiest way to change code which passes <code>APLOG_MARK</code> to
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard its own functions is to define and use a different macro that expands to
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding the parameters required by those functions, as <code>APLOG_MARK</code>
a812b025d139f465a31c76fc02ed162ed5271b03nd should only be used when calling <code>ap_log_*</code>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq directly. In this way, the code will remain compatible with HTTPD 2.0
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding and 2.2.</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <p>Code which calls <code>ap_log_*</code> without passing
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>APLOG_MARK</code> will necessarily differ between 2.4 and earlier
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding releases, as 2.4 requires a new third argument,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>APLOG_MODULE_INDEX</code>.</p>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <div class="example"><p><code>
11c3b5180e1de6776035320b012a28bb146e7b46chuck /* code for httpd 2.0/2.2 */<br />
a812b025d139f465a31c76fc02ed162ed5271b03nd ap_log_perror(file, line, APLOG_ERR, 0, p, "Failed to allocate dynamic lock structure");<br />
22d348febc3c258df246ac93e37945398dbf0348ianh <br />
22d348febc3c258df246ac93e37945398dbf0348ianh /* code for httpd 2.4 */<br />
22d348febc3c258df246ac93e37945398dbf0348ianh ap_log_perror(file, line, APLOG_MODULE_INDEX, APLOG_ERR, 0, p, "Failed to allocate dynamic lock structure");<br />
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm <br />
a812b025d139f465a31c76fc02ed162ed5271b03nd </code></p></div>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
1d7f1b96b49dafbd6cb414fb709cb85de2686a72chuck <p><code>ap_log_*error</code> are now implemented as macros. This means
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding that it is no longer possible to use <code>#ifdef</code> inside the
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard argument list of <code>ap_log_*error</code>, as this would cause
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding undefined behavor according to C99.</p>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <p>A <code>server_rec</code> pointer must be passed to
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>ap_log_error()</code> when called after startup. This
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding was always appropriate, but there are even more limitations with
9b3001f2097437c3c605d29e353fda5131b9952bminfrin a <code>NULL</code> <code>server_rec</code> in 2.4 than in
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe previous releases. Beginning with 2.3.12, the global variable
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <code>ap_server_conf</code> can always be used as
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe the <code>server_rec</code> parameter, as it will be
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <code>NULL</code> only when it is valid to pass <code>NULL</code>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe to <code>ap_log_error()</code>. <code>ap_server_conf</code>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe should be used only when a more appropriate <code>server_rec</code>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe is not available.</p>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <p>Consider the following changes to take advantage of the new
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <code>APLOG_TRACE1..8</code> log levels:</p>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <ul>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <li>Check current use of <code>APLOG_DEBUG</code> and
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe consider if one of the <code>APLOG_TRACEn</code> levels is
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe more appropriate.</li>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <li>If your module currently has a mechanism for configuring
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe the amount of debug logging which is performed, consider
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe eliminating that mechanism and relying on the use of
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe different <code>APLOG_TRACEn</code> levels. If expensive
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe trace processing needs to be bypassed depending on the
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe configured log level, use the <code>APLOGtrace<em>n</em></code>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe and <code>APLOGrtrace<em>n</em></code> macros to first check
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe if tracing is enabled.</li>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe </ul>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <p>Modules sometimes add process id and/or thread id to their log
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe messages. These ids are now logged by default, so it may not
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe be necessary for the module to log them explicitly. (Users may
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe remove them from the error log format, but they can be
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe instructed to add it back if necessary for problem diagnosis.)</p>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <h3><a name="upgrading_byfunction" id="upgrading_byfunction">If your module uses these existing APIs...</a></h3>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <dl>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <dt><code>ap_default_type()</code></dt>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <dd>This is no longer available; Content-Type must be configured
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe explicitly or added by the application.</dd>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <dt><code>ap_get_server_name()</code></dt>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <dd>If the returned server name is used in a URL,
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe use <code>ap_get_server_name_for_url()</code> instead. This new
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe function handles the odd case where the server name is an IPv6
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe literal address.</dd>
8632261c895a84c88ae6ade6ea4c62b27bd22b3ebrianp
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <dt><code>ap_get_server_version()</code></dt>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <dd>For logging purposes, where detailed information is
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe appropriate, use <code>ap_get_server_description()</code>.
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe When generating output, where the amount of information
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe should be configurable by ServerTokens, use
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <code>ap_get_server_banner()</code>.</dd>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <dt><code>ap_graceful_stop_signalled()</code></dt>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe <dd>Replace with a call
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe to <code>ap_mpm_query(AP_MPMQ_MPM_STATE)</code> and checking for
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe state <code>AP_MPMQ_STOPPING</code>.</dd>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <dt><code>ap_max_daemons_limit</code>, <code>ap_my_generation</code>,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding and <code>ap_threads_per_child</code></dt>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <dd>Use <code>ap_mpm_query()</code> query codes
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>AP_MPMQ_MAX_DAEMON_USED</code>, <code>AP_MPMQ_GENERATION</code>,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding and <code>AP_MPMQ_MAX_THREADS</code>, respectively.</dd>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <dt><code>ap_mpm_query()</code></dt>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <dd>Ensure that it is not used until after the register-hooks
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding hook has completed. Otherwise, an MPM built as a DSO
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding would not have had a chance to enable support for this
68ce856106f153813339db8670f6cd0ab8dea484minfrin function.</dd>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
45dac0729754e413ff7c673481b219e9ab1a11f1bnicholes <dt><code>ap_server_conf-&gt;process-&gt;pool</code>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard userdata</dt>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <dd>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq Optional:
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <ul>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <li>If your module uses this to determine which pass of the
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq startup hooks is being run,
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq use <code>ap_state_query(AP_SQ_MAIN_STATE)</code>.</li>
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <li>If your module uses this to maintain data across the
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq unloading and reloading of your module, use
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <code>ap_retained_data_create()</code> and
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <code>ap_retained_data_get()</code>.</li>
2ceedfca3a2fdfdb5ff60ca17f030ce91f6331cbwrowe </ul>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding </dd>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
68ce856106f153813339db8670f6cd0ab8dea484minfrin <dt><code>apr_global_mutex_create()</code>,
2e41eca72bcc4167d1871b0941ee79845540d58eminfrin <code>apr_proc_mutex_create()</code></dt>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <dd>Optional: See <code>ap_mutex_register()</code>,
68ce856106f153813339db8670f6cd0ab8dea484minfrin <code>ap_global_mutex_create()</code>, and
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>ap_proc_mutex_create()</code>; these allow your
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding mutexes to be configurable with
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding the <code class="directive"><a href="/mod/core.html#mutex">Mutex</a></code> directive;
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard you can also remove any configuration mechanisms in your
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding module for such mutexes
11c3b5180e1de6776035320b012a28bb146e7b46chuck </dd>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
33cb45dc8c5106018b7c2f6ae42478b109423e0eniq <dt><code>CORE_PRIVATE</code></dt>
11c3b5180e1de6776035320b012a28bb146e7b46chuck <dd>This is now unnecessary and ignored.</dd>
11c3b5180e1de6776035320b012a28bb146e7b46chuck
11c3b5180e1de6776035320b012a28bb146e7b46chuck <dt><code>dav_new_error()</code>
11c3b5180e1de6776035320b012a28bb146e7b46chuck and <code>dav_new_error_tag()</code></dt>
11c3b5180e1de6776035320b012a28bb146e7b46chuck <dd>Previously, these assumed that <code>errno</code> contained
11c3b5180e1de6776035320b012a28bb146e7b46chuck information describing the failure. Now,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding an <code>apr_status_t</code> parameter must be provided. Pass
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding 0/APR_SUCCESS if there is no such error information, or a valid
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>apr_status_t</code> value otherwise.</dd>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <dt><code>mpm_default.h</code>, <code>DEFAULT_LOCKFILE</code>,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>DEFAULT_THREAD_LIMIT</code>, <code>DEFAULT_PIDLOG</code>,
d7387fcd4969206172e3a2a8bbcd25a3d7011ac5rbb etc.</dt>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <dd>The header file and most of the default configuration
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding values set in it are no longer visible to modules. (Most can
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding still be overridden at build time.) <code>DEFAULT_PIDLOG</code>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding and <code>DEFAULT_REL_RUNTIMEDIR</code> are now universally
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding available via <code>ap_config.h</code>.</dd>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <dt><code>unixd_config</code></dt>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm <dd>This has been renamed to ap_unixd_config.</dd>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <dt><code>conn_rec-&gt;remote_ip</code> and
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>conn_rec-&gt;remote_addr</code></dt>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm <dd>These fields have been renamed in order to distinguish between
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard the client IP address of the connection and the useragent IP address
b999f6ba2a266bf9a92687f31bb7e76021ac5891ianh of the request (potentially overridden by a load balancer or proxy).
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard References to either of these fields must be updated with one of the
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard following options, as appropriate for the module:
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <ul>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm <li>When you require the IP address of the user agent, which
1cde33c7e2019830f8fb3224e01649305583916etrawick might be connected directly to the server, or might optionally be
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard separated from the server by a transparent load balancer or
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard proxy, use <code>request_rec-&gt;useragent_ip</code> and
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <code>request_rec-&gt;useragent_addr</code>.</li>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <li>When you require the IP address of the client that is
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding connected directly to the server, which might be the useragent or
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding might be the load balancer or proxy itself, use
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>conn_rec-&gt;client_ip</code> and
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code>conn_rec-&gt;client_addr</code>.</li>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding </ul>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding </dd>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding </dl>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <h3><a name="upgrading_byfeature" id="upgrading_byfeature">If your module interfaces with this feature...</a></h3>
a2f9f38db0931e6edf7b71378dd680c3c5fa5841rbb
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <dl>
5babe00918c88eda487771fa6d6d4a1a19c0ced0chuck <dt>suEXEC</dt>
5babe00918c88eda487771fa6d6d4a1a19c0ced0chuck <dd>Optional: If your module logs an error
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm when <code>ap_unixd_config.suexec_enabled</code> is 0,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding also log the value of the new
2e41eca72bcc4167d1871b0941ee79845540d58eminfrin field <code>suexec_disabled_reason</code>, which contains an
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding explanation of why it is not available.</dd>
35c9e4d2c0a6465746a98958ef756114834461e6minfrin
35c9e4d2c0a6465746a98958ef756114834461e6minfrin <dt>Extended status data in the scoreboard</dt>
5a5a6c22260854843c973e2ea9a14bec64362ab5wrowe <dd>In previous releases, <code>ExtendedStatus</code> had to be
d75bc22ab2702fa770f6935f07107efff16a76f0wrowe set to <code>On</code>, which in turn required that
11c3b5180e1de6776035320b012a28bb146e7b46chuck mod_status was loaded. In 2.4, just
35c9e4d2c0a6465746a98958ef756114834461e6minfrin set <code>ap_extended_status</code> to <code>1</code> in a
45dac0729754e413ff7c673481b219e9ab1a11f1bnicholes pre-config hook and the extended status data will be
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard available.</dd>
11c3b5180e1de6776035320b012a28bb146e7b46chuck </dl>
35c9e4d2c0a6465746a98958ef756114834461e6minfrin
35c9e4d2c0a6465746a98958ef756114834461e6minfrin
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <h3><a name="upgrading_newfeatures" id="upgrading_newfeatures">Does your module...</a></h3>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e2b2e15108eb7cb566b1d70ce4e479276d951de5minfrin <dl>
e2b2e15108eb7cb566b1d70ce4e479276d951de5minfrin <dt>Parse query args</dt>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <dd>Consider if <code>ap_args_to_table()</code> would be
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard helpful.</dd>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <dt>Parse form data...</dt>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <dd>Use <code>ap_parse_form_data()</code>.</dd>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <dt>Check for request header fields <code>Content-Length</code>
e2b2e15108eb7cb566b1d70ce4e479276d951de5minfrin and <code>Transfer-Encoding</code> to see if a body was
e2b2e15108eb7cb566b1d70ce4e479276d951de5minfrin specified</dt>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <dd>Use <code>ap_request_has_body()</code>.</dd>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <dt>Implement cleanups which clear pointer variables</dt>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard <dd>Use <code>ap_pool_cleanup_set_null()</code>.</dd>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard </dl>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard
e2b2e15108eb7cb566b1d70ce4e479276d951de5minfrin</div></div>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard<div class="bottomlang">
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard<p><span>Available Languages: </span><a href="/en/developer/new_api_2_4.html" title="English">&nbsp;en&nbsp;</a></p>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
e2b2e15108eb7cb566b1d70ce4e479276d951de5minfrin<script type="text/javascript"><!--//--><![CDATA[//><!--
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddardvar comments_shortname = 'httpd';
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddardvar comments_identifier = 'http://httpd.apache.org/docs/trunk/developer/new_api_2_4.html';
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard(function(w, d) {
35c9e4d2c0a6465746a98958ef756114834461e6minfrin if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
35c9e4d2c0a6465746a98958ef756114834461e6minfrin d.write('<div id="comments_thread"><\/div>');
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard var s = d.createElement('script');
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard s.type = 'text/javascript';
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding s.async = true;
3d350b6e1cb11fa790a6adb428856b5dd9857fecianh s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding else {
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
409f0f53a83313c59f1b227ed0a340adc1081e88wrowe }
409f0f53a83313c59f1b227ed0a340adc1081e88wrowe})(window, document);
409f0f53a83313c59f1b227ed0a340adc1081e88wrowe//--><!]]></script></div><div id="footer">
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard<p class="apache">Copyright 2012 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
409f0f53a83313c59f1b227ed0a340adc1081e88wrowe<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
5babe00918c88eda487771fa6d6d4a1a19c0ced0chuckif (typeof(prettyPrint) !== 'undefined') {
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding prettyPrint();
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard//--><!]]></script>
e6366481b8fe06a24337f0b30b7da66cf64d6062stoddard</body></html>