Skip to content

Instantly share code, notes, and snippets.

@tomoyk
Created March 9, 2020 06:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tomoyk/682d5ce370e639b2dda11a4ee78af640 to your computer and use it in GitHub Desktop.
Save tomoyk/682d5ce370e639b2dda11a4ee78af640 to your computer and use it in GitHub Desktop.

環境

$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

以下を参考にする。

https://www.openldap.org/software/download/

DTIのミラーが落ちていたので本体から落とす。

wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.48.tgz
tar xvf openldap-2.4.48.tgz
sudo mv openldap-2.4.48/ /opt

必要なパッケージ類を入れる。

$ sudo apt install libdb libltdl-dev

コンフィグ(適宜prefixなどを付与)

$ ./configure

依存関係のあるパッケージもビルドする。

$ make depend

ビルド

$ make -j `ls /dev/cpu/ | wc -l`

インストール

$ sudo make install

ユーザとグループの作成

sudo useradd -s /sbin/nologin openldap
sudo usermod -G openldap openldap

パスワードを設定

# この結果をメモる
sudo slappasswd

設定

cd /usr/local/etc/openldap/
cp ldap.conf ldap.conf.org

# メモった結果を設定に投入
vi ldap.conf

権限の修正

sudo chown -R openldap: /usr/local/var/openldap-data/
sudo chown -R openldap: /usr/local/etc/openldap/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment