Setting up a secondary CentOS Directory Server

A new Directory Server how-to is here!

Setting up a secondary CentOS Directory Server is a how-to describing how to install a second CentOS Directory Server and link it to a configuration/master Directory Server.  Just like it’s predecessor, this is a step-by-stop how-to that includes a sample session.

You can find the how-to at http://www.rainingpackets.com/wiki/doku.php?id=setting_up_a_secondary_centos_directory_server.

Adding Samba's ldap schema to CentOS Directory Server

Adding Samba’s ldap schema to CentOS Directory Server is a short how-to describing how to add Samba’s LDAP schema to CentOS’s Directory Server.  This how-to is permanently stored at http://www.rainingpackets.com/wiki/doku.php?id=adding_samba_s_ldap_schema_to_centos_directory_server. This how-to is based on the information found in  http://people.redhat.com/astokes/samba_rhds.pdf and http://directory.fedoraproject.org/wiki/Howto:Samba.

History

CentOS Directory Server is a bit of a different beast.  Unlike OpenLDAP,  Directory Server does not use regular scheme files.  Instead it stores its schema files in LDIF format.  This means you cannot just drop in schema files like you can with OpenLDAP.   Instead you have to convert the schema files to LDIF format.  Fortunately there is already a Perl script out there to do that, ol-schema-migrate.pl.

Prerequisites

  • CentOS Directory Server is installed and functional. You’ll need the instance name.
  • You have Samba’s LDAP schema on hand. The schema is included in the samba package.
  • A copy of ol-schema-migrate.pl, available at http://directory.fedoraproject.org/download/ol-schema-migrate.pl.
  • Perl installed so you can run ol-schema-migrate.pl.

Converting and installing the Samba Schema

  • In the following steps, our directory server instance is named dirserv1.
  • Directory Server stores it’s schema files in /etc/dirsrv/slapd-<instance name>/schema.
  1. Download the ol-schema-migrate.pl scriptif you haven’t already.
    # wget http://directory.fedoraproject.org/download/ol-schema-migrate.pl
  2. Convert the schema file to ldif format and put in in the directory server’s schema directory
    # perl ./ol-schema-migrate.pl -b /usr/share/doc/samba-3.0.33/LDAP/samba.schema > /etc/dirsrv/slapd-dirserv1/schema/61samba.ldif
  3. Restart the directory server
    # service dirsrv restart

Centos Directory Server How-to Updated

The CentOS Directory Server How-to has been updated. It now describes the whole installation process instead linking to external documentation and includes an entire sample installation.

You can find the latest version of theCentOS Directory Server How-to at http://www.rainingpackets.com/wiki/doku.php?id=setting_up_centos_directory_server_on_centos.

Setting up CentOS Directory Server on CentOS 5.4 Linux

UPDATE: The current version of this post is now available in the wiki.  Future updates will only be made to the wiki version.

Prerequisites
1. CentOS 5.4 is installed and running properly.  This could be a physical
server or a virtual machine.
2. You have root or sudo access to the server that the directory server is
to be installed on.
3. The server requires a fully qualified domain name.  This is because the
directory server will use the FQDN during it’s setup.
4. Make sure the server has an entry in /etc/hosts.   For example:
1.2.3.4 hostname.domain.tld hostname

Installing the packages
Unlike previous versions, CentOS Directory Server is now in the main
repositories so you no longer need to include the CentOS Extras repository.

1. Install the CentOS Directory Server package and it’s dependencies.
yum install centos-ds

Finalizing the install
Go through the Installation guide, available from RedHat at
http://www.redhat.com/docs/manuals/dir-server/8.1/install/index.html.  Don’t skip reading the Installation Guide or you will end up missing some key information in setting up the directory server.

A few notes:
1) OpenJDK is already installed and configured to be the default Java.
2) Make sure to read section 2.3 of the Installation Guide, Red Hat Enterprise Linux 4 and 5 Requirements.
3) I find that only by skipping step 4 of section 2.3.2.2 of the Installation Guide, do the new open file limits take effect.

All Directory Server manuals are available online at http://www.redhat.com/docs/manuals/dir-server/.

Setting up Directory Server
1) As root, run the directory server’s setup command
/usr/sbin/setup-ds-admin.pl

2) The Typical Install, is the most common install option.  It will let you
verify the settings being used, and change them if need be.

Things to take note of during the install.
1) Make sure the Computer Name is correct or later setting will be affected.
2) If the installer is not getting your server’s name correct, check your DNS
settings and /etc/hosts file values.
2) Take note of the admin password, you will need it later.
3) Take note of the Directory Manager password, you will need it later.

Once all the questions have been answered, you’re asked to setup the server.
Say yes. You willnow see the directory server being configured.

Creating directory server . . .
Your new DS instance 'directory' was successfully created.
Creating the configuration directory server . . .
Beginning Admin Server creation . . .
Creating Admin Server files and directories . . .
Updating adm.conf . . .
Updating admpw . . .
Registering admin server with the configuration directory server . . .
Updating adm.conf with information from configuration directory server . . .
Updating the configuration for the httpd engine . . .
Starting admin server . . .
The admin server was successfully started.
Admin server was successfully created, configured, and started.
Exiting . . .
Log file is '/tmp/setupBkwXhD.log'

Accessing the Directory Server

The Management Console is an X-window application for managing the directory server.  It is available at /usr/bin/redhat-idm-console.  Use the “admin” account and the password you gave it.  The value for “Administration URL” is found by running the command:
grep \^Listen /etc/dirsrv/admin-serv/console.conf