当前位置:文档之家› Apache Directory Server使用指南

Apache Directory Server使用指南

本教程是在笔者学习JNDI过程中,由于没有合适的免费服务器做为实验,给Sun的JNDI 教程的LDAP服务器使用的又是Sun的服务器,OpenLDAP又没有找到Windows的版本,所以就决定使用Apache的开源LDAP服务器---Apache Directory Server。

下面是Apache 网站对Apache Directory Project的介绍:The Apache Directory Project provides directory solutions entirely written in Java. These include a directory server, which has been certified as LDAP v3 compliant by the Open Group (Apache Directory Server), and Eclipse-based directory tools (Apache Directory Studio).Apache Directory项目提供了用纯Java编写的目录解决方案,其中包含ApacheDS,即Apache Directory Server,它是一个被授权的LDAP v3的服务器。

同时还包含基于Eclipse 的目录工具,即Apache Directory Studio。

ApacheDS基本用户参考指南,主要介绍了如何安装ApacheDS 1.0,通过不同的图形化客户端连接服务器,当然主要还是需要通过JNDI编程来实现服务器的连接,这部分内容在JNDI教程中进行介绍。

同时介绍了如何操作目录服务中的数据以及将ApacheDS和其它软件进行集成。

Apache Directory Server简介ApacheDS 1.0是一个由纯Java语言编写的开源LDAP服务器。

ApacheDS具有可嵌入、可扩展、标准的遵守LDAP协议等特性,同时支持其他的网络协议,例如NTP和Kerberos。

但是ApacheDS是一个LDAP服务器是最基本的。

各个特性介绍如下:Embeddable means that it is possible to configure, start and stop ApacheDS from other Java components, especially application servers, and the server runs within the same VM. The solution has already been successfully embedded in Apache Geronimo, JBoss, and others. The fact that the server is embeddable is quite interesting, nevertheless you also have the deployment option to run the server standalone, for instance as a Windows service. Perhaps you know this situation from other LDAP serversopen source (like OpenLDAP) as well as commercial ones (like Sun Java System Directory Server). This guide is dedicated to people that are new to ApacheDS. The guide concentrates on installing, configuring and running ApacheDS in a standalone configuration.Extendable means that the modern architecture of the solution provides many extension points. Write your own partitions to store directory data, interceptors to add functionality,(通过编写自定义分区来存储目录数据,编写自定义拦截器来增加功能。

这些都是通过使用Spring来实现特定的接口来完成的。

) etc. by implementing certain interfaces and plugging them in using Spring.Standard compliant means that ApacheDS 1.0 adheres to all RFCs relevant to LDAPv3. Please note that the server has been successfully certified by the Open Group in September 2006 ("LDAP certified"). Thus LDAP clients may rightly expect that ApacheDS behaves like they expect.Modern means that ApacheDS aims modernize the LDAP territory, as well as it favors standards compliance. New rich integration tier constructs like LDAP Stored Procedures and Triggers are being built on top of existing standards.Entirely written in Java means that the software compiles and runs on a huge number of hardware and software platforms. Native installers are available for Windows, MacOS and Solaris (both SPARC and intel platform), but in fact the set of possible targets is by far more extensive.(用Java写的有点就是可移植性好)整体架构一览:其中JNDI作为一个通用的接口来访问目录服务。

基本概念目录:一般来说,目录就是数据的集合或者清单。

现实世界中的例子有电话薄,教堂登记簿等。

这些例子的一个共同目的就是保存信息并且在需要的时候可以使用。

在信息技术中,directory这个概念用来表示一种特殊的数据存储。

它使用结构化存储和高效化获取对象,这些对象来自现实世界。

实体:所有的数据以实体为单位进行存储。

实体的集合组成一棵树。

目录服务:提供访问存储在目录中的信息的解决方案就叫做目录服务。

目录服务通过一个定义好的接口提供对目录内容的访问,如果使用网络的话,那么就需要一个合适的协议,LDAP 协议应运而生。

乍一看,目录服务作为数据存储工具与关系数据库存在竞争,但是实际上大多数大型企业或者组织同时使用目录服务和关系数据库。

LDAP发展历史:如下图所示:信息模型在LDAP的信息模型中,数据是以实体进行存储的,从而建立了一个层次化树状的结构。

每个实体都有唯一的名字,即DN,Distinguished Name,DN描述了实体在树中的具体位置。

实体由属性构成,属性是键值对key/value pairs。

一些属性可能在一个实体中不止出现一次(单值或者多值,例如一个人可能有不止一个电话号码)。

所谓的object class定义了一个实体可以有的属性以及哪些属性是必须的。

这些classes同样建立了一个层次结构,top作为这个层次的根。

这和面向对象相似。

top 只有objectclass属性,用来指派实体的object classes。

shcema由object classes和属性类型组成,因此它定义了哪种实体可以存储在目录中。

目录服务器管理schema,这些schema多数是由RFC标准进行定义的。

另外,大多数目录服务器允许用户定义object classes和属性。

基于LDAP目录的常见操作LDAP操作包括实体的创建,修改,删除以及查询。

上图展示了作为LDAP客户端的不同类型的软件产品。

ApacheDS的下载、安装和使用安装需求:Java 5.0(通过使用java –version命令进行查看)另外需要给JVM分配384MB的内存,这是默认的设置,笔者的RAM是2G的,所以无所谓了,如果内存较小的机器,可以通过控制台进行修改。

稍后介绍修改办法。

Apache网站提供了很多平台的本地安装包MacOS (jar)∙Solaris SPARC (jar)∙Solaris i386 (jar)∙Windows (exe)∙Debian package∙RPM package∙Linux (jar)可以从这里进行下载特定平台的安装文件。

如果是使用Linux系统的话,需要使用图形化用户界面进行安装,即X11图形用户界面。

笔者使用的系统是Windows,所以下载了Windows平台的安装文件,文件名为apacheds-1.0.2-win32-setup.exe,其中Apache网站还提供升级版本的安装文件,版本为1.5.1,这个版本是对应Java 5.0的版本,还不是稳定的版本。

下载后就可以进行安装了,注意安装的时候需要以管理员身份进行安装。

在安装过程中可以选择是否作为windows系统服务进行安装,这样就可以随windows系统启动的时候启动,笔者习惯自己启动所需的服务,所以不选择这个选项。

安装完成后,在开始菜单中具有程序菜单,主要有三个选项,分别为:其中第一个用于进行服务的设定,第二个用于测试服务运行是否出现错误,第三个用于打开任务监视器。

执行服务器设定,则打开下图的程序,在这里可以设置服务名、描述、启动类型(手动,自动,禁止)、启动、停止、暂停、重启程序,以及登录、日志记录位置、Java 设定以及启动和停止的一些选项,下图是一个基本的选项。

下图是Java选项的tab,可以在这里设置使用的JVM,Apache建议使用Sun的JDK,但是也支持其他的JDK,同时可以设置服务器的java类路径以及系统属性(Java Options),可以在这个界面修改服务器运行所需的内存。

相关主题