2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="mod_ldap.xml.meta">
26 <description>LDAP connection pooling and result caching services for use
27 by other LDAP modules</description>
28 <status>Extension</status>
29 <sourcefile>util_ldap.c</sourcefile>
30 <identifier>ldap_module</identifier>
31 <compatibility>Available in version 2.0.41 and later</compatibility>
34 <p>This module was created to improve the performance of
35 websites relying on backend connections to LDAP servers. In
36 addition to the functions provided by the standard LDAP
37 libraries, this module adds an LDAP connection pool and an LDAP
38 shared memory cache.</p>
40 <p>To enable this module, LDAP support must be compiled into
41 apr-util. This is achieved by adding the <code>--with-ldap</code>
42 flag to the <program>configure</program> script when building
45 <p>SSL/TLS support is dependant on which LDAP toolkit has been
46 linked to <glossary>APR</glossary>. As of this writing, APR-util supports:
47 <a href="http://www.openldap.org/">OpenLDAP SDK</a> (2.x or later),
48 <a href="http://developer.novell.com/ndk/cldap.htm">Novell LDAP
49 SDK</a>, <a href="http://www.mozilla.org/directory/csdk.html">
50 Mozilla LDAP SDK</a>, native Solaris LDAP SDK (Mozilla based),
51 native Microsoft LDAP SDK, or the
52 <a href="http://www.iplanet.com/downloads/developer/">iPlanet
53 (Netscape)</a> SDK. See the <a href="http://apr.apache.org">APR</a>
54 website for details.</p>
58 <section id="exampleconfig"><title>Example Configuration</title>
59 <p>The following is an example configuration that uses
60 <module>mod_ldap</module> to increase the performance of HTTP Basic
61 authentication provided by <module>mod_authnz_ldap</module>.</p>
63 <highlight language="config">
64 # Enable the LDAP connection pool and shared
65 # memory cache. Enable the LDAP cache status
66 # handler. Requires that mod_ldap and mod_authnz_ldap
67 # be loaded. Change the "yourdomain.example.com" to
70 LDAPSharedCacheSize 500000
73 LDAPOpCacheEntries 1024
76 <Location /ldap-status>
77 SetHandler ldap-status
79 Require host yourdomain.example.com
83 AuthName "LDAP Protected"
84 AuthBasicProvider ldap
85 AuthLDAPURL ldap://127.0.0.1/dc=example,dc=com?uid?one
91 <section id="pool"><title>LDAP Connection Pool</title>
93 <p>LDAP connections are pooled from request to request. This
94 allows the LDAP server to remain connected and bound ready for
95 the next request, without the need to unbind/connect/rebind.
96 The performance advantages are similar to the effect of HTTP
99 <p>On a busy server it is possible that many requests will try
100 and access the same LDAP server connection simultaneously.
101 Where an LDAP connection is in use, Apache will create a new
102 connection alongside the original one. This ensures that the
103 connection pool does not become a bottleneck.</p>
105 <p>There is no need to manually enable connection pooling in
106 the Apache configuration. Any module using this module for
107 access to LDAP services will share the connection pool.</p>
109 <p>LDAP connections can keep track of the ldap client
110 credentials used when binding to an LDAP server. These
111 credentials can be provided to LDAP servers that do not
112 allow anonymous binds during referral chasing. To control
113 this feature, see the <directive module="mod_ldap">
114 LDAPReferrals</directive> and <directive module="mod_ldap">
115 LDAPReferralHopLimit</directive> directives. By default,
116 this feature is enabled.</p>
119 <section id="cache"><title>LDAP Cache</title>
121 <p>For improved performance, <module>mod_ldap</module> uses an aggressive
122 caching strategy to minimize the number of times that the LDAP
123 server must be contacted. Caching can easily double or triple
124 the throughput of Apache when it is serving pages protected
125 with mod_authnz_ldap. In addition, the load on the LDAP server
126 will be significantly decreased.</p>
128 <p><module>mod_ldap</module> supports two types of LDAP caching during
129 the search/bind phase with a <em>search/bind cache</em> and
130 during the compare phase with two <em>operation
131 caches</em>. Each LDAP URL that is used by the server has
132 its own set of these three caches.</p>
134 <section id="search-bind"><title>The Search/Bind Cache</title>
135 <p>The process of doing a search and then a bind is the
136 most time-consuming aspect of LDAP operation, especially if
137 the directory is large. The search/bind cache is used to
138 cache all searches that resulted in successful binds.
139 Negative results (<em>i.e.</em>, unsuccessful searches, or searches
140 that did not result in a successful bind) are not cached.
141 The rationale behind this decision is that connections with
142 invalid credentials are only a tiny percentage of the total
143 number of connections, so by not caching invalid
144 credentials, the size of the cache is reduced.</p>
146 <p><module>mod_ldap</module> stores the username, the DN
147 retrieved, the password used to bind, and the time of the bind
148 in the cache. Whenever a new connection is initiated with the
149 same username, <module>mod_ldap</module> compares the password
150 of the new connection with the password in the cache. If the
151 passwords match, and if the cached entry is not too old,
152 <module>mod_ldap</module> bypasses the search/bind phase.</p>
154 <p>The search and bind cache is controlled with the <directive
155 module="mod_ldap">LDAPCacheEntries</directive> and <directive
156 module="mod_ldap">LDAPCacheTTL</directive> directives.</p>
159 <section id="opcaches"><title>Operation Caches</title>
160 <p>During attribute and distinguished name comparison
161 functions, <module>mod_ldap</module> uses two operation caches
162 to cache the compare operations. The first compare cache is
163 used to cache the results of compares done to test for LDAP
164 group membership. The second compare cache is used to cache
165 the results of comparisons done between distinguished
168 <p>Note that, when group membership is being checked, any sub-group
169 comparison results are cached to speed future sub-group comparisons.</p>
171 <p>The behavior of both of these caches is controlled with
172 the <directive module="mod_ldap">LDAPOpCacheEntries</directive>
173 and <directive module="mod_ldap">LDAPOpCacheTTL</directive>
177 <section id="monitoring"><title>Monitoring the Cache</title>
178 <p><module>mod_ldap</module> has a content handler that allows
179 administrators to monitor the cache performance. The name of
180 the content handler is <code>ldap-status</code>, so the
181 following directives could be used to access the
182 <module>mod_ldap</module> cache information:</p>
184 <highlight language="config">
185 <Location /server/cache-info>
186 SetHandler ldap-status
190 <p>By fetching the URL <code>http://servername/cache-info</code>,
191 the administrator can get a status report of every cache that is used
192 by <module>mod_ldap</module> cache. Note that if Apache does not
193 support shared memory, then each <program>httpd</program> instance has its
194 own cache, so reloading the URL will result in different
195 information each time, depending on which <program>httpd</program>
196 instance processes the request.</p>
200 <section id="usingssltls"><title>Using SSL/TLS</title>
202 <p>The ability to create an SSL and TLS connections to an LDAP server
203 is defined by the directives <directive module="mod_ldap">
204 LDAPTrustedGlobalCert</directive>, <directive module="mod_ldap">
205 LDAPTrustedClientCert</directive> and <directive module="mod_ldap">
206 LDAPTrustedMode</directive>. These directives specify the CA and
207 optional client certificates to be used, as well as the type of
208 encryption to be used on the connection (none, SSL or TLS/STARTTLS).</p>
210 <highlight language="config">
211 # Establish an SSL LDAP connection on port 636. Requires that
212 # mod_ldap and mod_authnz_ldap be loaded. Change the
213 # "yourdomain.example.com" to match your domain.
215 LDAPTrustedGlobalCert CA_DER /certs/certfile.der
217 <Location /ldap-status>
218 SetHandler ldap-status
220 Require host yourdomain.example.com
224 AuthName "LDAP Protected"
225 AuthBasicProvider ldap
226 AuthLDAPURL ldaps://127.0.0.1/dc=example,dc=com?uid?one
231 <highlight language="config">
232 # Establish a TLS LDAP connection on port 389. Requires that
233 # mod_ldap and mod_authnz_ldap be loaded. Change the
234 # "yourdomain.example.com" to match your domain.
236 LDAPTrustedGlobalCert CA_DER /certs/certfile.der
238 <Location /ldap-status>
239 SetHandler ldap-status
241 Require host yourdomain.example.com
245 AuthName "LDAP Protected"
246 AuthBasicProvider ldap
247 AuthLDAPURL ldap://127.0.0.1/dc=example,dc=com?uid?one TLS
254 <section id="settingcerts"><title>SSL/TLS Certificates</title>
256 <p>The different LDAP SDKs have widely different methods of setting
257 and handling both CA and client side certificates.</p>
259 <p>If you intend to use SSL or TLS, read this section CAREFULLY so as to
260 understand the differences between configurations on the different LDAP
261 toolkits supported.</p>
263 <section id="settingcerts-netscape"><title>Netscape/Mozilla/iPlanet SDK</title>
264 <p>CA certificates are specified within a file called cert7.db.
265 The SDK will not talk to any LDAP server whose certificate was
266 not signed by a CA specified in this file. If
267 client certificates are required, an optional key3.db file may
268 be specified with an optional password. The secmod file can be
269 specified if required. These files are in the same format as
270 used by the Netscape Communicator or Mozilla web browsers. The easiest
271 way to obtain these files is to grab them from your browser
274 <p>Client certificates are specified per connection using the
275 LDAPTrustedClientCert directive by referring
276 to the certificate "nickname". An optional password may be
277 specified to unlock the certificate's private key.</p>
279 <p>The SDK supports SSL only. An attempt to use STARTTLS will cause
280 an error when an attempt is made to contact the LDAP server at
283 <highlight language="config">
284 # Specify a Netscape CA certificate file
285 LDAPTrustedGlobalCert CA_CERT7_DB /certs/cert7.db
286 # Specify an optional key3.db file for client certificate support
287 LDAPTrustedGlobalCert CERT_KEY3_DB /certs/key3.db
288 # Specify the secmod file if required
289 LDAPTrustedGlobalCert CA_SECMOD /certs/secmod
290 <Location /ldap-status>
291 SetHandler ldap-status
293 Require host yourdomain.example.com
297 AuthName "LDAP Protected"
298 AuthBasicProvider ldap
299 LDAPTrustedClientCert CERT_NICKNAME <nickname> [password]
300 AuthLDAPURL ldaps://127.0.0.1/dc=example,dc=com?uid?one
307 <section id="settingcerts-novell"><title>Novell SDK</title>
309 <p>One or more CA certificates must be specified for the Novell
310 SDK to work correctly. These certificates can be specified as
311 binary DER or Base64 (PEM) encoded files.</p>
313 <p>Note: Client certificates are specified globally rather than per
314 connection, and so must be specified with the LDAPTrustedGlobalCert
315 directive as below. Trying to set client certificates via the
316 LDAPTrustedClientCert directive will cause an error to be logged
317 when an attempt is made to connect to the LDAP server..</p>
319 <p>The SDK supports both SSL and STARTTLS, set using the
320 LDAPTrustedMode parameter. If an ldaps:// URL is specified,
321 SSL mode is forced, override this directive.</p>
323 <highlight language="config">
324 # Specify two CA certificate files
325 LDAPTrustedGlobalCert CA_DER /certs/cacert1.der
326 LDAPTrustedGlobalCert CA_BASE64 /certs/cacert2.pem
327 # Specify a client certificate file and key
328 LDAPTrustedGlobalCert CERT_BASE64 /certs/cert1.pem
329 LDAPTrustedGlobalCert KEY_BASE64 /certs/key1.pem [password]
330 # Do not use this directive, as it will throw an error
331 #LDAPTrustedClientCert CERT_BASE64 /certs/cert1.pem
336 <section id="settingcerts-openldap"><title>OpenLDAP SDK</title>
338 <p>One or more CA certificates must be specified for the OpenLDAP
339 SDK to work correctly. These certificates can be specified as
340 binary DER or Base64 (PEM) encoded files.</p>
342 <p>Both CA and client certificates may be specified globally
343 (LDAPTrustedGlobalCert) or per-connection (LDAPTrustedClientCert).
344 When any settings are specified per-connection, the global
345 settings are superceded.</p>
347 <p>The documentation for the SDK claims to support both SSL and
348 STARTTLS, however STARTTLS does not seem to work on all versions
349 of the SDK. The SSL/TLS mode can be set using the
350 LDAPTrustedMode parameter. If an ldaps:// URL is specified,
351 SSL mode is forced. The OpenLDAP documentation notes that SSL
352 (ldaps://) support has been deprecated to be replaced with TLS,
353 although the SSL functionality still works.</p>
355 <highlight language="config">
356 # Specify two CA certificate files
357 LDAPTrustedGlobalCert CA_DER /certs/cacert1.der
358 LDAPTrustedGlobalCert CA_BASE64 /certs/cacert2.pem
359 <Location /ldap-status>
360 SetHandler ldap-status
362 Require host yourdomain.example.com
364 LDAPTrustedClientCert CERT_BASE64 /certs/cert1.pem
365 LDAPTrustedClientCert KEY_BASE64 /certs/key1.pem
366 # CA certs respecified due to per-directory client certs
367 LDAPTrustedClientCert CA_DER /certs/cacert1.der
368 LDAPTrustedClientCert CA_BASE64 /certs/cacert2.pem
371 AuthName "LDAP Protected"
372 AuthBasicProvider ldap
373 AuthLDAPURL ldaps://127.0.0.1/dc=example,dc=com?uid?one
380 <section id="settingcerts-solaris"><title>Solaris SDK</title>
382 <p>SSL/TLS for the native Solaris LDAP libraries is not yet
383 supported. If required, install and use the OpenLDAP libraries
388 <section id="settingcerts-microsoft"><title>Microsoft SDK</title>
390 <p>SSL/TLS certificate configuration for the native Microsoft
391 LDAP libraries is done inside the system registry, and no
392 configuration directives are required.</p>
394 <p>Both SSL and TLS are supported by using the ldaps:// URL
395 format, or by using the LDAPTrustedMode directive accordingly.</p>
397 <p>Note: The status of support for client certificates is not yet known
398 for this toolkit.</p>
405 <name>LDAPSharedCacheSize</name>
406 <description>Size in bytes of the shared-memory cache</description>
407 <syntax>LDAPSharedCacheSize <var>bytes</var></syntax>
408 <default>LDAPSharedCacheSize 500000</default>
409 <contextlist><context>server config</context></contextlist>
412 <p>Specifies the number of bytes to allocate for the shared
413 memory cache. The default is 500kb. If set to 0, shared memory
414 caching will not be used and every HTTPD process will create its
420 <name>LDAPSharedCacheFile</name>
421 <description>Sets the shared memory cache file</description>
422 <syntax>LDAPSharedCacheFile <var>directory-path/filename</var></syntax>
423 <contextlist><context>server config</context></contextlist>
426 <p>Specifies the directory path and file name of the shared memory
427 cache file. If not set, anonymous shared memory will be used if the
428 platform supports it.</p>
433 <name>LDAPCacheEntries</name>
434 <description>Maximum number of entries in the primary LDAP cache</description>
435 <syntax>LDAPCacheEntries <var>number</var></syntax>
436 <default>LDAPCacheEntries 1024</default>
437 <contextlist><context>server config</context></contextlist>
440 <p>Specifies the maximum size of the primary LDAP cache. This
441 cache contains successful search/binds. Set it to 0 to turn off
442 search/bind caching. The default size is 1024 cached
448 <name>LDAPCacheTTL</name>
449 <description>Time that cached items remain valid</description>
450 <syntax>LDAPCacheTTL <var>seconds</var></syntax>
451 <default>LDAPCacheTTL 600</default>
452 <contextlist><context>server config</context></contextlist>
455 <p>Specifies the time (in seconds) that an item in the
456 search/bind cache remains valid. The default is 600 seconds (10
462 <name>LDAPOpCacheEntries</name>
463 <description>Number of entries used to cache LDAP compare
464 operations</description>
465 <syntax>LDAPOpCacheEntries <var>number</var></syntax>
466 <default>LDAPOpCacheEntries 1024</default>
467 <contextlist><context>server config</context></contextlist>
470 <p>This specifies the number of entries <module>mod_ldap</module>
471 will use to cache LDAP compare operations. The default is 1024
472 entries. Setting it to 0 disables operation caching.</p>
477 <name>LDAPOpCacheTTL</name>
478 <description>Time that entries in the operation cache remain
480 <syntax>LDAPOpCacheTTL <var>seconds</var></syntax>
481 <default>LDAPOpCacheTTL 600</default>
482 <contextlist><context>server config</context></contextlist>
485 <p>Specifies the time (in seconds) that entries in the
486 operation cache remain valid. The default is 600 seconds.</p>
491 <name>LDAPReferralHopLimit</name>
492 <description>The maximum number of referral hops to chase before terminating an LDAP query.</description>
493 <syntax>LDAPReferralHopLimit <var>number</var></syntax>
494 <default>SDK dependent, typically between 5 and 10</default>
495 <contextlist><context>directory</context><context>.htaccess</context></contextlist>
496 <override>AuthConfig</override>
499 <p>This directive, if enabled by the <code>LDAPReferrals</code> directive,
500 limits the number of referral hops that are followed before terminating an
503 <note type="warning">
504 <p> Support for this tunable is uncommon in LDAP SDKs.</p>
510 <name>LDAPReferrals</name>
511 <description>Enable referral chasing during queries to the LDAP server.</description>
512 <syntax>LDAPReferrals <var>On|Off</var></syntax>
513 <default>LDAPReferrals On</default>
514 <contextlist><context>directory</context><context>.htaccess</context></contextlist>
515 <override>AuthConfig</override>
518 <p>Some LDAP servers divide their directory among multiple domains and use referrals
519 to direct a client when a domain boundary is crossed. By setting <code>LDAPReferrals On</code>
520 referrals will be chased (setting it to off causes referrals to be ignored). The directive
521 <code>LDAPReferralHopLimit</code> works in conjunction with this directive to limit the
522 number of referral hops to follow before terminating the LDAP query. When referral processing
523 is enabled client credentials will be provided, via a rebind callback, for any LDAP server
529 <name>LDAPRetryDelay</name>
530 <description>Configures the delay between LDAP server retries.</description>
531 <syntax>LDAPRetryDelay <var>seconds</var></syntax>
532 <default>LDAPRetryDelay 0</default>
533 <contextlist><context>server config</context></contextlist>
536 <p>If <directive>LDAPRetryDelay</directive> is set to a non-zero
537 value, the server will delay retrying an LDAP request for the
538 specified amount of time. Setting this directive to 0 will
539 result in any retry to occur without delay.</p>
541 <p>LDAP errors such as timeouts and refused connections are retryable.</p>
546 <name>LDAPRetries</name>
547 <description>Configures the number of LDAP server retries.</description>
548 <syntax>LDAPRetries <var>number-of-retries</var></syntax>
549 <default>LDAPRetries 3</default>
550 <contextlist><context>server config</context></contextlist>
552 <p>The server will retry failed LDAP requests up to
553 <directive>LDAPRetries</directive> times. Setting this
554 directive to 0 disables retries.</p>
555 <p>LDAP errors such as timeouts and refused connections are retryable.</p>
560 <name>LDAPTrustedGlobalCert</name>
561 <description>Sets the file or database containing global trusted
562 Certificate Authority or global client certificates</description>
563 <syntax>LDAPTrustedGlobalCert <var>type</var> <var>directory-path/filename</var> <var>[password]</var></syntax>
564 <contextlist><context>server config</context></contextlist>
567 <p>It specifies the directory path and file name of the trusted CA
568 certificates and/or system wide client certificates <module>mod_ldap</module>
569 should use when establishing an SSL or TLS connection to an LDAP
570 server. Note that all certificate information specified using this directive
571 is applied globally to the entire server installation. Some LDAP toolkits
572 (notably Novell) require all client certificates to be set globally using
573 this directive. Most other toolkits require clients certificates to be set
574 per Directory or per Location using LDAPTrustedClientCert. If you get this
575 wrong, an error may be logged when an attempt is made to contact the LDAP
576 server, or the connection may silently fail (See the SSL/TLS certificate
577 guide above for details).
578 The type specifies the kind of certificate parameter being
579 set, depending on the LDAP toolkit being used. Supported types are:</p>
581 <li>CA_DER - binary DER encoded CA certificate</li>
582 <li>CA_BASE64 - PEM encoded CA certificate</li>
583 <li>CA_CERT7_DB - Netscape cert7.db CA certificate database file</li>
584 <li>CA_SECMOD - Netscape secmod database file</li>
585 <li>CERT_DER - binary DER encoded client certificate</li>
586 <li>CERT_BASE64 - PEM encoded client certificate</li>
587 <li>CERT_KEY3_DB - Netscape key3.db client certificate database file</li>
588 <li>CERT_NICKNAME - Client certificate "nickname" (Netscape SDK)</li>
589 <li>CERT_PFX - PKCS#12 encoded client certificate (Novell SDK)</li>
590 <li>KEY_DER - binary DER encoded private key</li>
591 <li>KEY_BASE64 - PEM encoded private key</li>
592 <li>KEY_PFX - PKCS#12 encoded private key (Novell SDK)</li>
598 <name>LDAPTrustedClientCert</name>
599 <description>Sets the file containing or nickname referring to a per
600 connection client certificate. Not all LDAP toolkits support per
601 connection client certificates.</description>
602 <syntax>LDAPTrustedClientCert <var>type</var> <var>directory-path/filename/nickname</var> <var>[password]</var></syntax>
603 <contextlist><context>directory</context><context>.htaccess</context></contextlist>
606 <p>It specifies the directory path, file name or nickname of a
607 per connection client certificate used when establishing an SSL
608 or TLS connection to an LDAP server. Different locations or
609 directories may have their own independant client certificate
610 settings. Some LDAP toolkits (notably Novell)
611 do not support per connection client certificates, and will throw an
612 error on LDAP server connection if you try to use this directive
613 (Use the LDAPTrustedGlobalCert directive instead for Novell client
614 certificates - See the SSL/TLS certificate guide above for details).
615 The type specifies the kind of certificate parameter being
616 set, depending on the LDAP toolkit being used. Supported types are:</p>
618 <li>CA_DER - binary DER encoded CA certificate</li>
619 <li>CA_BASE64 - PEM encoded CA certificate</li>
620 <li>CERT_DER - binary DER encoded client certificate</li>
621 <li>CERT_BASE64 - PEM encoded client certificate</li>
622 <li>CERT_NICKNAME - Client certificate "nickname" (Netscape SDK)</li>
623 <li>KEY_DER - binary DER encoded private key</li>
624 <li>KEY_BASE64 - PEM encoded private key</li>
630 <name>LDAPTrustedMode</name>
631 <description>Specifies the SSL/TLS mode to be used when connecting to an LDAP server.</description>
632 <syntax>LDAPTrustedMode <var>type</var></syntax>
633 <contextlist><context>server config</context><context>virtual host</context></contextlist>
636 <p>The following modes are supported:</p>
638 <li>NONE - no encryption</li>
639 <li>SSL - ldaps:// encryption on default port 636</li>
640 <li>TLS - STARTTLS encryption on default port 389</li>
643 <p>Not all LDAP toolkits support all the above modes. An error message
644 will be logged at runtime if a mode is not supported, and the
645 connection to the LDAP server will fail.
648 <p>If an ldaps:// URL is specified, the mode becomes SSL and the setting
649 of LDAPTrustedMode is ignored.</p>
654 <name>LDAPConnectionTimeout</name>
655 <description>Specifies the socket connection timeout in seconds</description>
656 <syntax>LDAPConnectionTimeout <var>seconds</var></syntax>
657 <contextlist><context>server config</context></contextlist>
660 <p>This directive configures the LDAP_OPT_NETWORK_TIMEOUT (or LDAP_OPT_CONNECT_TIMEOUT)
661 option in the underlying LDAP client library, when available. This value
662 typically controls how long the LDAP client library will wait for the TCP
663 connection to the LDAP server to complete.</p>
665 <p> If a connection is not successful with the timeout period, either an error will be
666 returned or the LDAP client library will attempt to connect to a secondary LDAP
667 server if one is specified (via a space-separated list of hostnames in the
668 <directive module="mod_authnz_ldap">AuthLDAPURL</directive>).</p>
670 <p>The default is 10 seconds, if the LDAP client library linked with the
671 server supports the LDAP_OPT_NETWORK_TIMEOUT option.</p>
673 <note>LDAPConnectionTimeout is only available when the LDAP client library linked
674 with the server supports the LDAP_OPT_NETWORK_TIMEOUT
675 (or LDAP_OPT_CONNECT_TIMEOUT) option, and the ultimate behavior is
676 dictated entirely by the LDAP client library.
682 <name>LDAPTimeout</name>
683 <description>Specifies the timeout for LDAP search and bind operations, in seconds</description>
684 <syntax>LDAPTimeout <var>seconds</var></syntax>
685 <default>LDAPTimeout 60</default>
686 <contextlist><context>server config</context></contextlist>
687 <compatibility>Apache HTTP Server 2.3.5 and later</compatibility>
690 <p>This directive configures the timeout for bind and search operations, as well as
691 the LDAP_OPT_TIMEOUT option in the underlying LDAP client library, when available.</p>
693 <p> If the timeout expires, httpd will retry in case an existing connection has
694 been silently dropped by a firewall. However, performance will be much better if
695 the firewall is configured to send TCP RST packets instead of silently dropping
699 <p>Timeouts for ldap compare operations requires an SDK with LDAP_OPT_TIMEOUT, such as OpenLDAP >= 2.4.4.</p>
707 <name>LDAPVerifyServerCert</name>
708 <description>Force server certificate verification</description>
709 <syntax>LDAPVerifyServerCert <var>On|Off</var></syntax>
710 <default>LDAPVerifyServerCert On</default>
711 <contextlist><context>server config</context></contextlist>
714 <p>Specifies whether to force the verification of a
715 server certificate when establishing an SSL connection to the
722 <name>LDAPConnectionPoolTTL</name>
723 <description>Discard backend connections that have been sitting in the connection pool too long</description>
724 <syntax>LDAPConnectionPoolTTL <var>n</var></syntax>
725 <default>LDAPConnectionPoolTTL -1</default>
726 <contextlist><context>server config</context><context>virtual host</context></contextlist>
727 <compatibility>Apache HTTP Server 2.3.12 and later</compatibility>
730 <p>Specifies the maximum age, in seconds, that a pooled LDAP connection can remain idle
731 and still be available for use. Connections are cleaned up when they are next needed,
732 not asynchronously.</p>
734 <p>A setting of 0 causes connections to never be saved in the backend
735 connection pool. The default value of -1, and any other negative value,
736 allows connections of any age to be reused.</p>
738 <note><p>This timeout defaults to units of seconds, but accepts
739 suffixes for milliseconds (ms), minutes (min), and hours (h).
746 <name>LDAPLibraryDebug</name>
747 <description>Enable debugging in the LDAP SDK</description>
748 <syntax>LDAPLibraryDebug <var>7</var></syntax>
749 <default>disabled</default>
750 <contextlist><context>server config</context></contextlist>
753 <p>Turns on SDK-specific LDAP debug options that generally cause the LDAP
754 SDK to log verbose trace information to the main Apache error log.
755 The trace messages from the LDAP SDK provide gory details that
756 can be useful during debugging of connectivity problems with backend LDAP servers</p>
758 <p>This option is only configurable when Apache HTTP Server is linked with
759 an LDAP SDK that implements <code>LDAP_OPT_DEBUG</code> or
760 <code>LDAP_OPT_DEBUG_LEVEL</code>, such as OpenLDAP (a value of 7 is verbose)
761 or Tivoli Directory Server (a value of 65535 is verbose).</p>
763 <note type="warning">
764 <p>The logged information will likely contain plaintext credentials being used or
765 validated by LDAP authentication, so care should be taken in protecting and purging
766 the error log when this directive is used.</p>