1# OpenLDAP: pkg/openldap-guide/admin/install.sdf,v 1.38.2.8 2009/01/22 00:00:47 kurt Exp 2# Copyright 1999-2009 The OpenLDAP Foundation, All Rights Reserved. 3# COPYING RESTRICTIONS APPLY, see COPYRIGHT. 4 5H1: Building and Installing OpenLDAP Software 6 7This chapter details how to build and install the {{PRD:OpenLDAP}} 8Software package including {{slapd}}(8), the Standalone {{TERM:LDAP}} 9Daemon. Building and installing OpenLDAP Software requires several 10steps: installing prerequisite software, configuring OpenLDAP 11Software itself, making, and finally installing. The following 12sections describe this process in detail. 13 14 15H2: Obtaining and Extracting the Software 16 17You can obtain OpenLDAP Software from the project's download 18page at {{URL: http://www.openldap.org/software/download/}} or 19directly from the project's {{TERM:FTP}} service at 20{{URL: ftp://ftp.openldap.org/pub/OpenLDAP/}}. 21 22The project makes available two series of packages for {{general 23use}}. The project makes {{releases}} as new features and bug fixes 24come available. Though the project takes steps to improve stability 25of these releases, it is common for problems to arise only after 26{{release}}. The {{stable}} release is the latest {{release}} which 27has demonstrated stability through general use. 28 29Users of OpenLDAP Software can choose, depending on their desire 30for the {{latest features}} versus {{demonstrated stability}}, the 31most appropriate series to install. 32 33After downloading OpenLDAP Software, you need to extract the 34distribution from the compressed archive file and change your working 35directory to the top directory of the distribution: 36 37.{{EX:gunzip -c openldap-VERSION.tgz | tar xf -}} 38.{{EX:cd openldap-VERSION}} 39 40You'll have to replace {{EX:VERSION}} with the version name of 41the release. 42 43You should now review the {{F:COPYRIGHT}}, {{F:LICENSE}}, {{F:README}} 44and {{F:INSTALL}} documents provided with the distribution. The 45{{F:COPYRIGHT}} and {{F:LICENSE}} provide information on acceptable 46use, copying, and limitation of warranty of OpenLDAP Software. The 47{{F:README}} and {{F:INSTALL}} documents provide detailed information 48on prerequisite software and installation procedures. 49 50 51H2: Prerequisite software 52 53OpenLDAP Software relies upon a number of software packages distributed 54by third parties. Depending on the features you intend to use, you 55may have to download and install a number of additional software 56packages. This section details commonly needed third party software 57packages you might have to install. However, for an up-to-date 58prerequisite information, the {{F:README}} document should be 59consulted. Note that some of these third party packages may depend 60on additional software packages. Install each package per the 61installation instructions provided with it. 62 63 64H3: {{TERM[expand]TLS}} 65 66OpenLDAP clients and servers require installation of either {{PRD:OpenSSL}} 67or {{PRD:GnuTLS}} 68{{TERM:TLS}} libraries to provide {{TERM[expand]TLS}} services. Though 69some operating systems may provide these libraries as part of the 70base system or as an optional software component, OpenSSL and GnuTLS often 71require separate installation. 72 73OpenSSL is available from {{URL: http://www.openssl.org/}}. 74GnuTLS is available from {{URL: http://www.gnu.org/software/gnutls/}}. 75 76OpenLDAP Software will not be fully LDAPv3 compliant unless OpenLDAP's 77{{EX:configure}} detects a usable TLS library. 78 79 80H3: {{TERM[expand]SASL}} 81 82OpenLDAP clients and servers require installation of {{PRD:Cyrus SASL}} 83libraries to provide {{TERM[expand]SASL}} services. Though 84some operating systems may provide this library as part of the 85base system or as an optional software component, Cyrus SASL 86often requires separate installation. 87 88Cyrus SASL is available from 89{{URL:http://asg.web.cmu.edu/sasl/sasl-library.html}}. 90Cyrus SASL will make use of OpenSSL and Kerberos/GSSAPI libraries 91if preinstalled. 92 93OpenLDAP Software will not be fully LDAPv3 compliant unless OpenLDAP's 94configure detects a usable Cyrus SASL installation. 95 96 97H3: {{TERM[expand]Kerberos}} 98 99OpenLDAP clients and servers support {{TERM:Kerberos}} authentication 100services. In particular, OpenLDAP supports the Kerberos V 101{{TERM:GSS-API}} {{TERM:SASL}} authentication mechanism known as 102the {{TERM:GSSAPI}} mechanism. This feature requires, in addition to 103Cyrus SASL libraries, either {{PRD:Heimdal}} or {{PRD:MIT Kerberos}} 104V libraries. 105 106Heimdal Kerberos is available from {{URL:http://www.pdc.kth.se/heimdal/}}. 107MIT Kerberos is available from {{URL:http://web.mit.edu/kerberos/www/}}. 108 109Use of strong authentication services, such as those provided by 110Kerberos, is highly recommended. 111 112 113 114H3: Database Software 115 116OpenLDAP's {{slapd}}(8) {{TERM:BDB}} and {{TERM:HDB}} primary database backends 117require {{ORG[expand]Oracle}} {{PRD:Berkeley DB}}. 118If not available at configure time, you will not be able to build 119{{slapd}}(8) with these primary database backends. 120 121Your operating system may provide a supported version of 122{{PRD:Berkeley DB}} in the base system or as an optional 123software component. If not, you'll have to obtain and 124install it yourself. 125 126{{PRD:Berkeley DB}} is available from {{ORG[expand]Oracle}}'s Berkeley DB 127download page 128{{URL: http://www.oracle.com/technology/software/products/berkeley-db/index.html}}. 129 130There are several versions available. Generally, the most recent 131release (with published patches) is recommended. This package is required 132if you wish to use the {{TERM:BDB}} or {{TERM:HDB}} database backends. 133 134Note: Please see {{SECT:Recommended OpenLDAP Software Dependency Versions}} for 135more information. 136 137 138H3: Threads 139 140OpenLDAP is designed to take advantage of threads. OpenLDAP 141supports POSIX {{pthreads}}, Mach {{CThreads}}, and a number of 142other varieties. {{EX:configure}} will complain if it cannot 143find a suitable thread subsystem. If this occurs, please 144consult the {{F:Software|Installation|Platform Hints}} section 145of the OpenLDAP FAQ {{URL: http://www.openldap.org/faq/}}. 146 147 148H3: TCP Wrappers 149 150{{slapd}}(8) supports TCP Wrappers (IP level access control filters) 151if preinstalled. Use of TCP Wrappers or other IP-level access 152filters (such as those provided by an IP-level firewall) is recommended 153for servers containing non-public information. 154 155 156H2: Running configure 157 158Now you should probably run the {{EX:configure}} script with the 159{{EX:--help}} option. 160This will give you a list of options that you can change when building 161OpenLDAP. Many of the features of OpenLDAP can be enabled or disabled 162using this method. 163!if 0 164Please see the appendix for a more detailed list of configure options, 165and their usage. 166!endif 167> ./configure --help 168 169The {{EX:configure}} script will also look at various environment variables 170for certain settings. These environment variables include: 171 172!block table; align=Center; coltags="EX,N"; title="Table 4.1: Environment Variables" 173Variable Description 174CC Specify alternative C Compiler 175CFLAGS Specify additional compiler flags 176CPPFLAGS Specify C Preprocessor flags 177LDFLAGS Specify linker flags 178LIBS Specify additional libraries 179!endblock 180 181Now run the configure script with any desired configuration options or 182environment variables. 183 184> [[env] settings] ./configure [options] 185 186As an example, let's assume that we want to install OpenLDAP with 187BDB backend and TCP Wrappers support. By default, BDB 188is enabled and TCP Wrappers is not. So, we just need to specify 189{{EX:--with-wrappers}} to include TCP Wrappers support: 190 191> ./configure --with-wrappers 192 193However, this will fail to locate dependent software not 194installed in system directories. For example, if TCP Wrappers 195headers and libraries are installed in {{F:/usr/local/include}} 196and {{F:/usr/local/lib}} respectively, the {{EX:configure}} 197script should be called as follows: 198 199> env CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" \ 200> ./configure --with-wrappers 201 202Note: Some shells, such as those derived from the Bourne {{sh}}(1), 203do not require use of the {{env}}(1) command. In some cases, environmental 204variables have to be specified using alternative syntaxes. 205 206The {{EX:configure}} script will normally auto-detect appropriate 207settings. If you have problems at this stage, consult any platform 208specific hints and check your {{EX:configure}} options, if any. 209 210 211H2: Building the Software 212 213Once you have run the {{EX:configure}} script the last line of output 214should be: 215> Please "make depend" to build dependencies 216 217If the last line of output does not match, {{EX:configure}} has failed, 218and you will need to review its output to determine what went wrong. 219You should not proceed until {{EX:configure}} completes successfully. 220 221To build dependencies, run: 222> make depend 223 224Now build the software, this step will actually compile OpenLDAP. 225> make 226 227You should examine the output of this command carefully to make sure 228everything is built correctly. Note that this command builds the LDAP 229libraries and associated clients as well as {{slapd}}(8). 230 231 232H2: Testing the Software 233 234Once the software has been properly configured and successfully 235made, you should run the test suite to verify the build. 236 237> make test 238 239Tests which apply to your configuration will run and they should pass. 240Some tests, such as the replication test, may be skipped if not supported 241by your configuration. 242 243 244H2: Installing the Software 245 246Once you have successfully tested the software, you are ready to 247install it. You will need to have write permission to the installation 248directories you specified when you ran configure. By default 249OpenLDAP Software is installed in {{F:/usr/local}}. If you changed 250this setting with the {{EX:--prefix}} configure option, it will be 251installed in the location you provided. 252 253Typically, the installation requires {{super-user}} privileges. 254From the top level OpenLDAP source directory, type: 255 256> su root -c 'make install' 257 258and enter the appropriate password when requested. 259 260You should examine the output of this command carefully to make sure 261everything is installed correctly. You will find the configuration files 262for {{slapd}}(8) in {{F:/usr/local/etc/openldap}} by default. See the 263chapter {{SECT:Configuring slapd}} for additional information. 264 265