本章介绍如何配置目录代理服务器实例。本章中的过程使用 dpadm 和 dpconf 命令。有关这些命令的信息,请参见 dpadm(1M) 和 dpconf(1M) 手册页。
本章包含以下主题:
本部分介绍如何修改目录代理服务器的配置。
可以使用 DSCC 执行此任务。有关信息,请参见目录服务控制中心界面和 DSCC 联机帮助。
查找目录代理服务器的当前配置。
$ dpconf get-server-prop -h host -p port |
或者,查看一个或多个配置属性的当前设置。
$ dpconf get-server-prop -h host -p port property-name ... |
例如,通过运行以下命令确定是否允许未经验证的操作:
$ dpconf get-server-prop -h host -p port allow-unauthenticated-operations allow-unauthenticated-operations : true |
更改一个或多个配置参数。
$ dpconf set-server-prop -h host -p port property:value ... |
例如,通过运行以下命令禁止未经验证的操作:
$ dpconf set-server-prop -h host -p port allow-unauthenticated-operations:false |
如果您尝试执行非法更改,则此更改将不会生效。例如,如果将 allow-unauthenticated-operations 参数设置为 f 而不是 false,则会产生以下错误:
$ dpconf set-server-prop -h host -p port allow-unauthenticated-operations:f The value "f" is not a valid value for the property "allow-unauthenticated-operations". Allowed property values: BOOLEAN The "set-server-prop" operation failed. |
重新启动目录代理服务器实例以使更改生效(如有必要)。
有关重新启动目录代理服务器的信息,请参见重新启动目录代理服务器。
使用 dpadm 备份目录代理服务器时,将备份配置文件和服务器证书。如果已实现目录代理服务器虚拟 ACI,也会备份 ACI。
只要服务器成功启动,目录代理服务器即会自动备份 conf.ldif 文件。
可以使用 DSCC 执行此任务。有关信息,请参见目录服务控制中心界面和 DSCC 联机帮助。
停止目录代理服务器实例。
$ dpadm stop instance-path |
备份目录代理服务器实例。
$ dpadm backup instance-path archive-dir |
archive-dir 目录由 backup 命令创建,并且在运行此命令之前不得存在。此目录包含每个配置文件和证书的备份。
可以使用 DSCC 执行此任务。有关信息,请参见目录服务控制中心界面和 DSCC 联机帮助。
停止目录代理服务器实例。
$ dpadm stop instance-path |
恢复目录代理服务器实例。
$ dpadm restore instance-path archive-dir |
如果实例路径存在,将以无提示方式执行恢复操作。archive-dir 目录中的配置文件和证书将替换 instance-path 目录中的配置文件和证书。
如果实例路径不存在,恢复操作将会失败。
代理管理员是特权管理员,与 UNIX® 系统上的 root 用户类似。代理管理员条目是在创建目录代理服务器实例时定义的。代理管理员的默认 DN 为 cn=Proxy Manager。
可以查看和更改代理管理员的 DN 和密码,如以下过程所示。
可以使用 DSCC 执行此任务。有关信息,请参见目录服务控制中心界面和 DSCC 联机帮助。
查找代理管理员的配置。
$ dpconf get-server-prop -h host -p port configuration-manager-bind-dn configuration-manager-bind-pwd configuration-manager-bind-dn : cn=proxy manager configuration-manager-bind-pwd : {3DES}U77v39WX8MDpcWVrueetB0lfJlBc6/5n |
代理管理员的默认值为 cn=proxy manager。将为配置管理员密码返回一个散列值。
更改代理管理员的 DN。
$ dpconf set-server-prop -h host -p port configuration-manager-bind-dn:bindDN |
创建包含代理管理员密码的文件,并设置指向该文件的属性。
$ dpconf set-server-prop -h host -p port configuration-manager-bind-pwd-file:filename |
对目录代理服务器及其实体的大多数配置更改都可以联机进行。某些更改需要重新启动服务器后才能生效。如果对下表中的任何属性进行配置更改,都必须重新启动服务器:
bind-dn client-cred-mode db-name db-pwd db-url db-user distribution-algorithm ldap-address ldap-port ldaps-port lexicographic-attrs lexicographic-lower-bound lexicographic-upper-bound listen-address listen-port load-balancing-algorithm num-bind-init num-read-init num-write-init number-of-search-threads number-of-threads number-of-worker-threads numeric-attrs numeric-default-data-view numeric-lower-bound numeric-upper-bound pattern-matching-base-object-search-filter pattern-matching-dn-regular-expression pattern-matching-one-level-search-filter pattern-matching-subtree-search-filter replication-role ssl-policy use-external-schema
属性的 rws 和 rwd 关键字表明对该属性的更改是否需要重新启动服务器。
如果某个属性具有 rws(read(读)、write(写)、static(静态))关键字,则在更改属性后必须重新启动服务器。
如果某个属性具有 rwd(read(读)、write(写)、dynamic(动态))关键字,则可动态完成对该属性的修改操作(无需重新启动服务器)。
要确定对某个属性的更改是否需要重新启动服务器,请运行以下命令:
$ dpconf help-properties | grep property-name
例如,要确定更改 LDAP 数据源的绑定 DN 是否需要重新启动服务器,请运行以下命令:
$ dpconf help-properties | grep bind-dn connection-handler bind-dn-filters rwd STRING | any This property specifies a set of regular expressions. The bind DN of a client must match at least one regular expression in order for the connection to be accepted by the connection handler. (Default: any) ldap-data-source bind-dn rws DN | "" This property specifies the DN to use when binding to the LDAP data source. (Default: undefined)
要确定进行配置更改后是否必须重新启动服务器,请运行以下命令:
$ dpconf get-server-prop -h host -p port is-restart-required
目录代理服务器的配置条目位于 cn=config 中。在默认情况下,使用目录代理服务器访问配置条目时,将访问目录代理服务器的配置条目。
要访问目录服务器的配置条目,请使用目录服务器,而不要使用目录代理服务器。有关如何配置目录服务器的信息,请参见第 3 章,目录服务器配置。
如果重新配置目录代理服务器以访问目录服务器的配置条目,很可能会破坏目录代理服务器的管理框架。
要使用目录代理服务器访问目录服务器的配置条目,请采用特殊步骤,以确保不会破坏目录代理服务器的管理框架。本部分介绍如何使用目录代理服务器访问目录服务器的配置条目。
创建一个或多个数据源,如创建和配置 LDAP 数据源中所述。
创建 LDAP 数据源池,如创建和配置 LDAP 数据源池中所述。
将一个或多个数据源连接到此数据源池,如将 LDAP 数据源连接到数据源池中所述。
要公开某个特定数据源的配置条目,请只将一个 LDAP 数据源连接到 LDAP 数据源池。
$ dpconf attach-ldap-data-source -h host -p port pool-name data-source-name |
执行此步骤后,客户端即可访问连接到目录代理服务器的数据源的配置条目。
要公开任意数据源的配置条目,请将多个 LDAP 数据源连接到 LDAP 数据源池。
$ dpconf attach-ldap-data-source -h host -p port pool-name data-source-name \ data-source-name ... |
执行此步骤后,客户端即可访问连接到目录代理服务器的任一数据源的配置条目。但是,客户端无法知道这些配置条目属于哪个数据源。
创建 LDAP 数据视图以公开 cn=config。
$ dpconf create-ldap-data-view -h host -p port view-name pool-name cn=dir-config |