Distribution of substantive ly modified versions of this docum ent is prohibited without the expli c it permission of the copyright holder.
Distribution of the work or derivative of the work in any standard (paper) book form for commercial purposes is prohibited unless prior permission
is obtained from the copyright holder.
Red Hat and the Red Hat "Shadow Man" logo are registere d tra de marks of Red Hat, Inc. in the Unite d States and other countrie s.
All other tradema r ks re ferenced herein are the property of their respective owners.
The GPG fingerprint of the security@redhat.com key is:
CA 20 86 86 2B D6 9D FC 65 F6 EC C4 21 91 80 CD DB 42 A6 0E
12Red Hat Directory Server Gateway Customization Guide • April 2005
Preface
The descriptions, instructions, and examples in this guide can be used to create and modify
a gateway instance to suit the needs of users in your organization. The preface contains the
following sections:
•Prerequisite Reading (page 17)
•Conventions Used in This Book (page 18)
•Related Information (page 18)
Prerequisite Reading
This guide explains Red Hat Directory Server Gateway and is intended for anyone who
needs to implement a simple gateway instance with basic directory lookup fun c tionality. It
is also for users who wish to implement a more powerful gateway instance with directory
authentication and administration capability.
This guide assumes the reader is familiar with HTML file syntax and has a rudimentary
understanding of how the LDAP directory stores information. The guide does not describe
many of the basic directory and architectural concepts that you need to deploy, install, and
administer your directory service successfully. Tho se concepts are contained in the Red Hat Directory Server Deployment Guid e an d Red Hat Directory Server Ad ministrator’s Guide.
You should read those books before continuing with this manual.
When you are familiar with Directory Server concepts and have done some preliminary
planning for your directory service, you can install the Directory Server. The instructions
for installing the various Directory Server components are contained in the Red Hat Directory Server Installation Guide.
Also, Managing Servers wit h Red Hat Co nsole contains general backgroun d information on
how to use the Red Hat C ons ol e. Yo u s ho uld r ead and understand the concept s in th at bo ok
before you attempt to administer Directory Server.
17
Conventions Used in This Book
Conventions Used in This Book
This section explains the conventions used in this book.
•
Monospaced font — This typeface is used for any text that appears on the
computer screen or text that you should type. It is also used for filenames, functions,
and examples.
•Notes and Cautions text boxes.
NOTENotes and Cautions mark important information. Make sure you read the
information before continuing with a task.
•The greater than symbol (>) is used as a s eparator fo r successiv e menu se lections. For
example, Object > New > User means that you should pull down the Object menu,
drag the mouse down to highlight New, and drag the mouse across to the New
submenu in which you must select User.
•Throughout this book you will see path references of the form:
serverRoot
serverRoot
/usr/redhat/servers. On Windows, it is c:\redhat\servers. If you have
installed Directory Server in a different location, you should adapt the path
accordingly.
serverID is the ID or identifier you assigned to an instance of Directory Server when
you installed it. For example, if you gave the server an identifier of
the actual path would look like this:
/usr/redhat/servers/slapd-phonebook/. . .
•All paths specified in this manual are in UNIX format. If you are using a
Windows-based Directory Server, you should assume the equivalent file paths
whenever UNIX file paths are shown in this book.
•In examples/sample code, paths assume that the Directory Server is installed in the
default location
in a different location, adapt the paths accordingly.
/slapd-serverID/...
is the installation directory. The default installation directory for UNIX is
/usr/redhat/servers. If you have instal led your Dir ectory Server
Related Information
phonebook, then
The document set for Directory Server also contains the following guides:
18Red Hat Directory Server Gateway Customization Guide • April 2005
Related Information
•Red Hat Directory Server Deployment Guide. Provides an overvie w for planning you r
deployment of the Directory Server. Includes deployment examples.
•Red Hat Directory Server Installation Gui de. Contains procedures for installing your
Directory Server as well as procedures for migrating your Directory Server.
•Red Hat Directory Server Administrator’s Guide. Contains procedures for the
day-to-day maintenance of you r directo ry service. In cludes informati on on confi guring
server-side plug-ins.
•Red Hat Directory Server Configuration, Command, and File Reference. Contains
information about using the command-line scripts shipped with Directory Server.
•Red Hat Directory Server Schema Reference. Contains information about the Di rectory
Server schema.
•Red Hat Directory Server Plug-in Programmer’s Guide. Describes how to w rite
server plug-ins in order to customize and extend the capabilities of Directory Server.
•Red Hat Directory Server Org Chart. Introduces the Red Hat Directory Server Org
Chart application and explains how to integrate it with an instance of Directory Server.
•Red Hat Directory Server DSML Gateway Guide. Introduces the Red Hat Directory
Server DSML Gateway function and explains how to customize it for use as an
independent gatewa y.
For a list of documentation installed with Directory Server, open the
serverRoot/manual/en/slapd/index.htm file.
For the latest information about Directory Se rver, includ ing cu rren t releas e notes , co mplete
product documentation, technical notes, and deployment information, check this site:
http://www.redhat.com/docs/manuals/dir-server/
Preface19
Relate d Information
20Red Hat Directory Server Gateway Customization Guide • April 2005
Chapter1
Introduction
This chapter descri bes the gateway functionality of Red Hat Direc tory Server (Director y
Server). The chapter contains the following sections:
•What Is a Gateway? (page 21)
•Directory Express and Default Gateway (page 23)
•Support for Multiple Gateway Instances (page 25)
•Anonymous and Non-Anonymous Searching (page 27)
•Automatic Updates to Directory Configuration (page 27)
What Is a Gateway?
A gateway is an HTTP-to-LDAP client that lives on an HTTP server. Using special
directives embedded in HTML files, a gateway allows users to access user directory data
using any kind of web browser. Using a gateway does not require login to the Red Hat
Console.
In Directory Server, many gateway ins tances can be def ined on on e HTTP server, p roviding
access to any number of Directory Servers. A gateway instance consists of the following:
•A
•An HTML directory for object class templates and other files containing gateway
•A configuration directory for directory search, directory authentication, language files,
.conf file, stored in the serverRoot/clients/dsgw/context directory, defining
the context for gateway instance. For example,
instance.
directives used to communicate with Directory Server.
and gateway scripts.
dsgw.conf defines the dsgw gateway
21
What Is a Gateway?
Gateways Installed with Directory Server
Two gateway instances are installed during Directory Server installation: the default
gateway and Directory Express. Both gateways are configured to use the suffix set when
the Directory Server was configured and non-SSL (Secure Socket Layer)
communications.
NOTEA Java gateway based on the DSML protocol is also installed with
Directory Server. For more information on using and configuring the
DSML gateway, refer to the Red Hat Directory Server DSML Gateway Guide.
For more information, see “Location of Gateway Files,” on page 29.
Default Gateway
The configuration file for the default gateway is at
serverRoot/clients/dsgw/context/dsgw.conf.
Following Directory Server installation, the default gateway can be accessed from
22Red Hat Directory Server Gateway Customization Guide • April 2005
Directory Express and Default Gateway
Directory Express
The configuration file for Directory Express is
serverRoot/clients/dsgw/context/pb.conf.
During Directory Server installation, Directory Express is configured to use the Red Hat
Administration Server installed with the directory as its HTTP server.
Following Directory Server installation, Directory Express can be accessed from
A gateway instance requires an HTTP server that can communicate with Directory Server.
For optimum performance and highest security, the gateway should be configured to run
under a high-performance HTTP server, such as the Red Hat Enterprise Server.
For more information, see “HTTP Server Configuration,” on page 32.
Directory Express and Default Gateway
The following sections describe Directory Express and the Default Gateway in detail:
•Directory Express (pb.conf)
•Default Gateway (dsgw.conf)
Directory Express (pb.conf)
Directory Express is a basic directory lookup tool that can be used out of the box.
Chapter 1Introduction23
Directory Express and Default Gateway
Figure 1-1Directory Express: Search Result
Figure 1-2Directory Express: Extended Search Result s
24Red Hat Directory Server Gateway Customization Guide • April 2005
Support for Multiple Gateway Instances
Default Gateway (dsgw.conf)
In addition to the standard search form, the default gateway provides an advanced search
form, a Directory Server authentication form, and a form for adding and modifying entries.
Figure 1-3Default Gateway
Support for Multiple Ga teway I nstances
Directory Server supports multiple gateway instances — that is, many gateways can access
directory data from the same HTTP server without conflict.
The
.conf files defining the configuration of gateway instances are stored in the
serverRoot/clients/dsgw/context directory. Within the .conf file are two parameters
specifying the path names for the HTML and template files for the gateway. The following
lines show the HTML and configuration directories specified in the
htmldir../pbhtml
configdir ../pbconfig
pb.conf file:
Chapter 1Introduction25
Support for Multiple Gateway Instances
Specifying Gateway Configuration to Gateway CGIs
Information about which .conf file to use is communicated in the QUERY STRING using
a
GET and through a hidden variable on a POST.
GET Operations (GCONTEXT)
In a GET operation, gateway CGIs get the gatewa y context f rom the QUERY STRING in the
URL.
Use the
GCONTEXT directive in all URLs to gateway CGIs. Embed
<!--GCONTEXT -->
after the CGI name, as shown in the example that follows. This directive will be replaced
by the current CGI’s gateway context. The
GCONTEXT directive is the only gateway
directive that does not have to be at the beginning of the line. An example of embedding
the
GCONTEXT string in a link follows:
<a href=/clients/dsgw/bin/lang?<!-- GCONTEXT
-->&file=auth.html>click</a>
POST Operations (PCONTEXT)
In a POST operation, the CGI posts to the gateway instance specified by a hidden variable
on an HTML form. Each
PCONTEXT directive so that CGIs can pass the gateway instance to the next page and
maintain the state.
For CGI invocations using a
<!-- PCONTEXT -->
at the beginning of a line. For example, you can specify
follows:
POST operation to a gateway C GI in an HTML for m must use the
The default gateway and Directory Express are available from the page for the Red Hat
Administration Serve r (
http://adminHost:adminPort).
Anonymous and Non-Anonymous Searching
The gateway supports both anonymous and non-anonymous searching. Anonymous
searching provides basic per missions for acce ssing information in the user dir ectory. A bind
DN and bind password, st ored in a
the Directory Server. User permissions for directory access can be defined in the Red Hat
Console.
If the Directory Server contains authentication credentials for a user, these ov erride the bind
DN and bind password in the gateway’s
credentials expire or are invalid, the gateway attempts to authenticate the user to the
directory using t he
binds anonymously.
binddnfile. When no binddnfile is specified, the gateway ins tance
binddnfile, can be set up for users to authenticate to
binndnfile parameter. When authentication
binddnfile
The location of the binddnfile containing bind DNs and bind passwords for individual
users and groups of users is specified in the gateway’s
NOTEThe
binddnfile contains highly sensitive information. Do not store the
binddnfile under serverRoot/clients/dsgw or in any directory that is
served up over HTTP (for instance,
to store the
binddnfile).
.conf file.
/bin/slapd/server is a good place
Automatic Updates to Directory Configuration
A script that updates gateway instances with changes to Directory Server configuration,
updatedsgw, is included with the Directory Server installation. This script searches
serverRoot/clients/dsgw/context for gateway instances that match the Directory
Server host and port.
Chapter 1Introduction27
Automatic Updates to Directory Configuration
The updatedsgw script runs automatically for gateways installed on the Red Hat
Administration Server managing the Directory Server instance. When the server port or
root DN (or other settings, such as directory manager) for a Directory Server instance is
changed, the Red Hat Administration Server managing the Directory Server instance runs
the
updatedsgw script.
For more information, see “Updating the Gateway with Changes to Directory Server
Configuration,” on page 31.
28Red Hat Directory Server Gateway Customization Guide • April 2005
Chapter2
Setting Up the Gateway
This chapter describes the planning decisions and tasks required to install and initially
configure a gateway for access by end users. The chapter contains the following sections:
•Gateway Installation Planning (page 29)
•HTTP Server Configuration (page 32)
•Creating a New Gateway Instance (page 36)
•Gateway .conf File Configuration (page 37)
•Configuring Gateway Clients (page 40)
Gateway Installation Planning
The following sections describe the steps for planning your installation of the gateway:
•Location of Gateway Files
•Securing Gateway Configuration and Settings
•Updating the Gateway with Changes to Directory Server Configuration
•HTTP Server Recommendations for Directory Server Gateway
Location of Gateway Files
Table 2-1 shows the locations of gateway files.
29
Gateway Installation Planning
Two gateway instances are installed during Directory Server installation: Red Hat
Directory Express (Directory Express) and the default gateway. The configuration files
(
pb.conf and dsgw.conf) for the two instances are stored in the
serverRoot/clients/dsgw/context directory. Additional gateways can be created by
customizing Directory Express or the default gateway.
Unique gateway instances may have unique HTML directories (for example,
..clients/dsgw/mythml) and template directories (for example,
..clients/dsgw/myconfig). However, gateways may also be cloned to use identical
HTML and template directories while pointing to different Directory Servers or different
suffixes on a Directory Server.
For more information on cloning the gateway, see “Gateway Cloning,” on page 37.
Securing Gateway Configuration and Settings
The following sections describe procedure for protecting the configuration information of
your gateway.
•Protecting Bind DN and Password
•Protecting Root Processes on UNIX Systems
30Red Hat Directory Server Gateway Customization Guide • April 2005
Gateway Installation Planning
Protecting Bind DN and Password
The gateway configuration files reference files that contain sensitive information, including
the
binddnfile parameter containing the bind DN and bind password used to permit
non-anonymous searchi ng of the directo ry. The
the gateway configurati on direct o ry (
served up over HTTP.
serverRoot/clients/dsgw) or in any directory that is
binddnfile should not be stored under
Protecting Root Processes on UNIX Systems
On UNIX systems, it is not advisable to run the gateway from a Red Hat Administration
Server that is also running a server process as
about the configuration of your Directory Servers.
root. This may expose sensitive information
Updating the Gateway with Changes to Directory
Server Configuration
Directory Server Gateway includes a script, updatedsgw, that can be used to update all
gateway instances with changes to the Directory Server configuration, including changes to
Directory Server port, host, suffix, and root DN (the ability to update the suffix is not
available in the server administration console). The
serverRoot/bin/slapd/admin/bin directory.
updatedsgw script is stored in the
Changes made to the Directory Server configuration (
are posted to
updated only when the host and port for the gateway match the host and port of the
Directory Server.
NOTEThe Directory Server’s root DN (the Directory Server’s superuser) must
updatedsgw, and the relevant gateway files are updated. These files will be
match the value of the gateway’s
dse.ldif) by the Red Ha t Console
dirmgr parameter.
HTTP Server Recommendations for Directory Server
Gateway
The Red Hat Administration Server is the default HTTP server for the two gateway clients
that are installed with the Directory Server. Both Directory Express and the default gateway
are preconfigured to run under the Administration Server without additional setup.
Chapter 2Setting Up the Gateway31
HTTP Server Configuration
NOTEIt is not advisable to run the gateway from an Administration Server that is
There are many factors affecting gateway performance on an HTTP server, including the
following:
•The number of users accessing the gateway at a given time.
•The complexity of the directory searches performed and the search results required.
•Whether the gateway is additionally to be used for authentication and login.
•The load from other processes managed by the host machine.
•The speed and performance of the computer hardware selected for the host computer.
•The speed and capacity of the network (network hardware and software).
In general, gateway performance on the Administration Server will begin to slow down
when the number of users accessing the gateway throughout the enterprise reaches 6,000
people. (This is a very general recommendation that does not take into account factors
listed above, especially the speed of the host machine.)
also running a server process as
information about the configuration of your Directory Servers.
root. This may expose sensitive
Running the Gateway in High-Usage Networks
Network administrators expecting high gateway usage may wish to move the gateway to a
high-performance HTTP server that is dedicated to running the gateway.
HTTP Server Configuration
The following sections describe the steps for configuring an HTTP server:
•Name Translation Mapping
•Gateway Root Suffix
•Configuring the Gateway for Web Servers
32Red Hat Directory Server Gateway Customization Guide • April 2005
HTTP Server Configuration
Name Translation Mapping
The HTTP server uses Name Translation mapping to translate a virtual path provided by a
gateway client to a physical path used by an HTTP server. This Name Translation mapping
specifies the gateway’s HTML directory. The gateway’s CGIs use this information to
output the correct URL (HTTP redirection). The NameTrans mapping is specified in the
gateway’s configuration file using the
gwnametrans parameter.
For more information on configuring the
page 97.
gwnametrans parameter, see “gwnametrans,” on
Gateway Root Suffix
Directory Express and the default gateway are set to the root suffix specified during
Directory Server installation. This suffix specifies the DN for the LDAP database and
represents a root in the directory tree (for example,
gateways can be set up on an HTTP server that provide access to directory entries that
correspond to this root suffix.
When the Directory Server’s suffix changes, it is necessary to run the
manually to propagate the change to all gateway instances.
NOTEWhen the root suffix, directory manager, or port change, the gateway
settings in
haven’t been updated by Red Hat Console).
dsgw.conf must be updated to reflect the changes (if they
dc=example,dc=com). Multiple
updatedsgw script
Configuring the Gateway for Web Servers
Directory Express and the default gateway are installed with the Directory Server and
configured to run under the Red Hat Administration Server, which is the default HTTP
server for the gateway clients. No additional configuration is necessary. However,
customers in high-usage networks may wish to move their gateways (or set up new
gateways) on a high-performance HTTP server.
Setting up a gateway with a web server typically requires:
1.Changing all the host names and port number s in the configurati on files ( config.txt,
dsgw.conf, pb.conf, default.conf, and so on).
Chapter 2Setting Up the Gateway33
HTTP Server Configuration
2.Adding the following CGI directories (under Program Management).
Prefix:
/clients/dsgw/bin
CGI Directory: serverRoot/clients/dsgw/bin
(On Windows, add them as shell CGI directories.)
3.Adding an additional Document directory (under Content Management).
Prefix:
/clients
Directory: serverRoot/clients
Changing permissions of the cookie directory (req ui red for UNI X only ).
4.
The configuration procedures outlined in this section assume that a Red Hat Enterprise
Server is installed and configured to communicate with Directory Server. For Red Hat
Enterprise Server documentation, check this site:
http://www.redhat.com/docs/manuals/dir-server/
For configuring other HTTP servers, follow the documentation that came with the
product.
To configure the gateway to work with Red Hat Enterprise Server, follow the instructions
below:
1.Add an additional CGI directory.
Adding an additional CGI direct ory is necessary to make the gat eway’s CGI prog rams
available. For additional information, see