「OpenLDAP」:修訂間差異
跳至導覽
跳至搜尋
第7行: | 第7行: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
另外會安裝<code>ldap-utils</code>,主要是因為CLI下常用的工具不在OpenLDAP內提供,而是透過第三方的方式操作(像是<code>ldapmodify</code>、<code>ldapdelete</code>): | 另外會安裝<code>ldap-utils</code>,主要是因為CLI下常用的工具不在OpenLDAP內提供,而是透過第三方的方式操作(像是<code>ldapmodify</code>、<code>ldapdelete</code>這些指令): | ||
<syntaxhighlight lang="shell-session"> | <syntaxhighlight lang="shell-session"> | ||
# apt install ldap-utils | # apt install ldap-utils |
於 2018年3月30日 (五) 08:04 的修訂
OpenLDAP是一套LDAP伺服器軟體。
安裝
由於OpenLDAP 2.4在2007年十月發行,至今只有一直發行minor release,所以通常都可以透過系統的套件裝到合理的版本:
# apt install slapd
另外會安裝ldap-utils
,主要是因為CLI下常用的工具不在OpenLDAP內提供,而是透過第三方的方式操作(像是ldapmodify
、ldapdelete
這些指令):
# apt install ldap-utils
設定
Ubuntu 16.04內的版本預設會使用目錄結構設定檔(預設讀取/etc/ldap/slapd.d/
整個目錄),但這跟網路上一般使用單檔設定不同(通常會是/etc/ldap/slapd.conf
),所以我們要告知slapd使用檔案設定檔。
這要修改/etc/default/slapd
的內容,將SLAPD_CONF
參數從空的值改為/etc/ldap/slapd.conf
:
# Default location of the slapd.conf file or slapd.d cn=config directory. If
# empty, use the compiled-in default (/etc/ldap/slapd.d with a fallback to
# /etc/ldap/slapd.conf).
SLAPD_CONF=/etc/ldap/slapd.conf
同時我們要將範本複製過來修改(範本在/usr/share/slapd/slapd.conf
這邊),裡面有一些變數需要設定:
@BACKEND@
設為mdb
。@SUFFIX@
設為dc=example,dc=com
。@ADMIN@
設為cn=Manager,dc=example,dc=com
。
其中的dc=example,dc=com
為範例,可以依照實際組織設定。
另外因為使用mdb,需要將dbconfig
的參數都刪除掉(這些是給BerkeleyDB,也就是bdb使用)。