10.2. 配置 ACME 数据库
本节论述了如何为 ACME 响应器配置数据库。数据库配置位于 /etc/pki/pki-tomcat/acme/database.conf
。
您可以使用
pki-server acme-database-mod
命令通过命令行配置数据库。在没有参数的情况下调用此命令会启动一个互动模式,例如:$ pki-server acme-database-mod The current value is displayed in the square brackets. To keep the current value, simply press Enter. To change the current value, enter the new value. To remove the current value, enter a blank space. Enter the type of the database. Available types: ds, in-memory, ldap, openldap, postgresql. Database Type: ds Enter the location of the LDAP server (e.g. ldap://localhost.localdomain:389). Server URL [ldap://localhost.localdomain:389]: Enter the authentication type. Available types: BasicAuth, SslClientAuth. Authentication Type [BasicAuth]: Enter the bind DN. Bind DN [cn=Directory Manager]: Enter the bind password. Bind Password [ ****** ]: Enter the base DN for the ACME subtree. Base DN [dc=acme,dc=pki,dc=example,dc=com]:
-
使用--
type
参数调用 命令会根据指定的类型创建新的配置。 - 使用其他参数调用 命令会更新指定的参数。
某些 ACME 配置属性存储在数据库中,可让您一致地配置集群中的所有 ACME 响应器。默认情况下,ACAC 响应器在检索或更新 ACME 配置属性时直接访问数据库,这可能会增加数据库的负载。有些数据库可能会提供 ACME 配置监控器来减少这个负载。
10.2.1. 配置 DS 数据库
您可以将 ACME 响应器配置为使用 DS 数据库。一个 DS 数据库配置示例位于 /usr/share/pki/acme/database/ds/database.conf
。
配置 DS 数据库:
首先使用以下命令导入
/usr/share/pki/acme/database/ds/schema.ldif
文件来添加 ACME DS 模式:$ ldapmodify -h $HOSTNAME -x -D "cn=Directory Manager" -w Secret.123 \ -f /usr/share/pki/acme/database/ds/schema.ldif
-
接下来,准备 LDIF 文件以创建 ACME 子树。示例 LDIF 文件位于
usr/share/pki/acme/database/ds/create.ldif
。本例使用dc=acme,dc=pki,dc=example,dc=com
作为基本 DN。 使用
ldapadd
命令导入 LDIF 文件:$ ldapadd -h $HOSTNAME -x -D "cn=Directory Manager" -w Secret.123 \ -f /usr/share/pki/acme/database/ds/create.ldif
将示例数据库配置文件从
/usr/share/pki/acme/database/ds/database.conf
复制到/etc/pki/pki-tomcat/acme
目录中,或者执行以下命令来自定义一些参数:$ pki-server acme-database-mod --type ds \ -DbindPassword=Secret.123
根据需要自定义配置:
在独立 ACME 部署中,
database.conf
应该类似如下:class=org.example.acme.database.DSDatabase url=ldap://<hostname>:389 authType=BasicAuth bindDN=cn=Directory Manager bindPassword=Secret.123 baseDN=dc=acme,dc=pki,dc=example,dc=com
在共享的 CA 和 ACME 部署中,database.conf 应该类似如下:
class=org.example.acme.database.DSDatabase configFile=conf/ca/CS.cfg baseDN=dc=acme,dc=pki,dc=example,dc=com
DS 数据库使用搜索持久性提供 ACME 配置监控器。您可以通过设置以下参数来启用它: monitor.enabled=true