Skip to content

Install Tarball

If you've downloaded OpenLDAP or another LDAP-related tool in the form of a tarball (a .tar.gz or .tar.bz2 file), the process of installation is a bit different. Here’s how you can install a program from a tarball on Linux or macOS:

Steps to Install from a Tarball:

1. Extract the Tarball:

First, you need to extract the contents of the tarball. Assuming you have a .tar.gz file, use the following command:

tar -xzvf openldap-x.y.z.tar.gz
  • Replace openldap-x.y.z.tar.gz with the actual name of the file you downloaded.

If the tarball is in .tar.bz2 format, use:

tar -xjvf openldap-x.y.z.tar.bz2

2. Navigate to the Extracted Directory:

Once extracted, move into the directory where the tarball was unpacked:

cd openldap-x.y.z

3. Install Dependencies:

Before you can compile and install OpenLDAP (or another tool), you’ll likely need some dependencies installed, such as:

  • Build tools: gcc, make, autoconf, libtool
  • Libraries: libssl-dev, libsasl2-dev, libdb-dev, etc.

For Ubuntu/Debian-based systems, install dependencies like this:

sudo apt update
sudo apt install build-essential libssl-dev libsasl2-dev libdb-dev

For Red Hat/CentOS:

sudo yum install gcc make openssl-devel cyrus-sasl-devel db4-devel

4. Configure the Installation:

After installing the required dependencies, you can configure the build environment for the software. Typically, there’s a configure script in the extracted directory.

Run the following command to configure the build options:

./configure
  • This script checks your system for necessary tools and libraries, preparing the software to be compiled.
  • If you need to customize the installation (such as changing installation paths), you can specify options like this:
./configure --prefix=/opt/openldap

5. Compile the Source:

After configuration is done, compile the source code using the make command:

make
  • This may take some time depending on your system’s performance.

6. Install the Software:

Once the build process is complete, install the software on your system:

sudo make install
  • This will copy the files to the appropriate directories (typically /usr/local/ or a custom directory if you specified one with --prefix).

7. Post-Installation Configuration:

After installation, you might need to perform additional steps such as configuring the OpenLDAP server (slapd) or managing its settings. Here are a few things you might want to do:

  • Set up the LDAP database and schemas.
  • Edit configuration files (e.g., /etc/openldap/slapd.conf or /etc/ldap/slapd.d).
  • Start the LDAP service:

    sudo systemctl start slapd
    

  • Enable it to start on boot:

    sudo systemctl enable slapd
    

8. Verify Installation:

To verify if OpenLDAP or another LDAP tool has been successfully installed, you can run:

slapd -V

This should show you the version of OpenLDAP if it's installed correctly.


Example of Installing OpenLDAP from Tarball:

If you have a tarball of OpenLDAP, the process would generally follow these steps:

  1. Extract the tarball:

    tar -xzvf openldap-2.5.9.tar.gz
    

  2. Navigate to the extracted directory:

    cd openldap-2.5.9
    

  3. Install dependencies:

    sudo apt install build-essential libssl-dev libsasl2-dev libdb-dev
    

  4. Configure the build environment:

    ./configure
    

  5. Build dependencies if required (Optional):

    make depend
    

  6. Compile the source code:

    make
    

  7. Run tests (Optional):

    make test
    

  8. Install the software:

    sudo make install