xml version="1.0" encoding="ISO-8859-1"?>
|
Apache HTTP Server Version 2.2 ![]() Apache Module mod_ldapAvailable Languages: en
SummaryThis module was created to improve the performance of websites relying on backend connections to LDAP servers. In addition to the functions provided by the standard LDAP libraries, this module adds an LDAP connection pool and an LDAP shared memory cache. To enable this module, LDAP support must be compiled into
apr-util. This is achieved by adding the SSL/TLS support is dependant on which LDAP toolkit has been linked to APR. As of this writing, APR-util supports: OpenLDAP SDK (2.x or later), Novell LDAP SDK, Mozilla LDAP SDK, native Solaris LDAP SDK (Mozilla based), native Microsoft LDAP SDK, or the iPlanet (Netscape) SDK. See the APR website for details. Directives
TopicsExample ConfigurationThe following is an example configuration that uses
LDAP Connection PoolLDAP connections are pooled from request to request. This allows the LDAP server to remain connected and bound ready for the next request, without the need to unbind/connect/rebind. The performance advantages are similar to the effect of HTTP keepalives. On a busy server it is possible that many requests will try and access the same LDAP server connection simultaneously. Where an LDAP connection is in use, Apache will create a new connection alongside the original one. This ensures that the connection pool does not become a bottleneck. There is no need to manually enable connection pooling in the Apache configuration. Any module using this module for access to LDAP services will share the connection pool. LDAP CacheFor improved performance,
The Search/Bind CacheThe process of doing a search and then a bind is the most time-consuming aspect of LDAP operation, especially if the directory is large. The search/bind cache is used to cache all searches that resulted in successful binds. Negative results (i.e., unsuccessful searches, or searches that did not result in a successful bind) are not cached. The rationale behind this decision is that connections with invalid credentials are only a tiny percentage of the total number of connections, so by not caching invalid credentials, the size of the cache is reduced.
The search and bind cache is controlled with the Operation CachesDuring attribute and distinguished name comparison
functions, The behavior of both of these caches is controlled with
the Monitoring the Cache
By fetching the URL Using SSL/TLSThe ability to create an SSL and TLS connections to an LDAP server
is defined by the directives
SSL/TLS CertificatesThe different LDAP SDKs have widely different methods of setting and handling both CA and client side certificates. If you intend to use SSL or TLS, read this section CAREFULLY so as to understand the differences between configurations on the different LDAP toolkits supported. Netscape/Mozilla/iPlanet SDKCA certificates are specified within a file called cert7.db. The SDK will not talk to any LDAP server whose certificate was not signed by a CA specified in this file. If client certificates are required, an optional key3.db file may be specified with an optional password. The secmod file can be specified if required. These files are in the same format as used by the Netscape Communicator or Mozilla web browsers. The easiest way to obtain these files is to grab them from your browser installation. Client certificates are specified per connection using the LDAPTrustedClientCert directive by referring to the certificate "nickname". An optional password may be specified to unlock the certificate's private key. The SDK supports SSL only. An attempt to use STARTTLS will cause an error when an attempt is made to contact the LDAP server at runtime.
Novell SDKOne or more CA certificates must be specified for the Novell SDK to work correctly. These certificates can be specified as binary DER or Base64 (PEM) encoded files. Note: Client certificates are specified globally rather than per connection, and so must be specified with the LDAPTrustedGlobalCert directive as below. Trying to set client certificates via the LDAPTrustedClientCert directive will cause an error to be logged when an attempt is made to connect to the LDAP server.. The SDK supports both SSL and STARTTLS, set using the LDAPTrustedMode parameter. If an ldaps:// URL is specified, SSL mode is forced, override this directive.
OpenLDAP SDKOne or more CA certificates must be specified for the OpenLDAP SDK to work correctly. These certificates can be specified as binary DER or Base64 (PEM) encoded files. Client certificates are specified per connection using the LDAPTrustedClientCert directive. The documentation for the SDK claims to support both SSL and STARTTLS, however STARTTLS does not seem to work on all versions of the SDK. The SSL/TLS mode can be set using the LDAPTrustedMode parameter. If an ldaps:// URL is specified, SSL mode is forced. The OpenLDAP documentation notes that SSL (http://www.vanessaatkinson.com/spacer.gif) support has been deprecated to be replaced with TLS, although the SSL functionality still works.
Solaris SDKSSL/TLS for the native Solaris LDAP libraries is not yet supported. If required, install and use the OpenLDAP libraries instead. Microsoft SDKSSL/TLS certificate configuration for the native Microsoft LDAP libraries is done inside the system registry, and no configuration directives are required. Both SSL and TLS are supported by using the ldaps:// URL format, or by using the LDAPTrustedMode directive accordingly. Note: The status of support for client certificates is not yet known for this toolkit. LDAPCacheEntries Directive
Specifies the maximum size of the primary LDAP cache. This cache contains successful search/binds. Set it to 0 to turn off search/bind caching. The default size is 1024 cached searches. LDAPCacheTTL Directive
Specifies the time (in seconds) that an item in the search/bind cache remains valid. The default is 600 seconds (10 minutes). LDAPConnectionTimeout Directive
Specifies the timeout value (in seconds) in which the module will attempt to connect to the LDAP server. If a connection is not successful with the timeout period, either an error will be returned or the module will attempt to connect to a secondary LDAP server if one is specified. The default is 10 seconds. LDAPOpCacheEntries Directive
This specifies the number of entries LDAPOpCacheTTL Directive
Specifies the time (in seconds) that entries in the operation cache remain valid. The default is 600 seconds. LDAPSharedCacheFile Directive
Specifies the directory path and file name of the shared memory cache file. If not set, anonymous shared memory will be used if the platform supports it. LDAPSharedCacheSize Directive
Specifies the number of bytes to allocate for the shared memory cache. The default is 100kb. If set to 0, shared memory caching will not be used. LDAPTrustedClientCert Directive
It specifies the directory path, file name or nickname of a per connection client certificate used when establishing an SSL or TLS connection to an LDAP server. Different locations or directories may have their own independant client certificate settings. Some LDAP toolkits (notably Novell) do not support per connection client certificates, and will throw an error on LDAP server connection if you try to use this directive (Use the LDAPTrustedGlobalCert directive instead for Novell client certificates - See the SSL/TLS certificate guide above for details). The type specifies the kind of certificate parameter being set, depending on the LDAP toolkit being used. Supported types are:
LDAPTrustedGlobalCert Directive
mod_ldap
should use when establishing an SSL or TLS connection to an LDAP
server. Note that all certificate information specified using this directive
is applied globally to the entire server installation. Some LDAP toolkits
(notably Novell) require all client certificates to be set globally using
this directive. Most other toolkits require clients certificates to be set
per Directory or per Location using LDAPTrustedClientCert. If you get this
wrong, an error may be logged when an attempt is made to contact the LDAP
server, or the connection may silently fail (See the SSL/TLS certificate
guide above for details).
The type specifies the kind of certificate parameter being
set, depending on the LDAP toolkit being used. Supported types are:
LDAPTrustedMode Directive
The following modes are supported:
Not all LDAP toolkits support all the above modes. An error message will be logged at runtime if a mode is not supported, and the connection to the LDAP server will fail. If an ldaps:// URL is specified, the mode becomes SSL and the setting of LDAPTrustedMode is ignored. LDAPVerifyServerCert Directive
Specifies whether to force the verification of a server certificate when establishing an SSL connection to the LDAP server. Available Languages: en |