linux:389-directory-server

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:389-directory-server [2013/10/02 14:59] – [初期設定のバックアップ] ともやんlinux:389-directory-server [2019/05/18 02:23] (現在) – 外部編集 非ログインユーザー
行 3: 行 3:
  日本語の文献を探す場合は、Fedora Directory Server(FDS) を検索する方が良いかもしれません。\\  日本語の文献を探す場合は、Fedora Directory Server(FDS) を検索する方が良いかもしれません。\\
 \\ \\
- 以降では、Fedora 14 の環境に 389 Directory Server を導入してみたいと思う。\\+ 以降では、Fedora 19 の環境に 389 Directory Server を導入してみ。\\
  
 ===== 389-ds のインストール ===== ===== 389-ds のインストール =====
行 20: 行 20:
  サービス実行ユーザーの作成  サービス実行ユーザーの作成
 <code> <code>
-$ sudo groupadd -g 10000 389ds +$ sudo groupadd -g 10000 ldap 
-$ sudo useradd -u 10000 -g 389ds 389ds+$ sudo useradd -u 10000 -g ldap ldap
 </code> </code>
-===== Linuxサーバーのチューニング =====+===== Linuxのチューニング =====
  以下の資料に習って設定をすませておく。\\  以下の資料に習って設定をすませておく。\\
 [[http://directory.fedoraproject.org/wiki/Performance_Tuning#Linux|389 Directory Server (Open Source LDAP)]]\\ [[http://directory.fedoraproject.org/wiki/Performance_Tuning#Linux|389 Directory Server (Open Source LDAP)]]\\
 +\\
  チューニングをすませておかないとセットアップ中に警告される事がある。\\  チューニングをすませておかないとセットアップ中に警告される事がある。\\
 <code> <code>
行 48: 行 49:
  
 ==== ファイルディスクリプタ上限の変更 ==== ==== ファイルディスクリプタ上限の変更 ====
 + 最終行に設定を追記する。
 <code> <code>
 $ sudo vi /etc/security/limits.conf  $ sudo vi /etc/security/limits.conf 
 </code> </code>
 <code> <code>
-# End of file 
 *               soft    nofile          8192 *               soft    nofile          8192
 *               hard    nofile          8192 *               hard    nofile          8192
 </code> </code>
  
 +<code>
 +$ sudo vi /etc/profile 
 +</code>
 +<code>
 +ulimit -n 8192
 +</code>
 ==== ネットワークパラメータの変更 ==== ==== ネットワークパラメータの変更 ====
 + 最終行に設定を追記する。
 <code> <code>
 $ sudo vi /etc/sysctl.conf $ sudo vi /etc/sysctl.conf
行 63: 行 71:
 <code> <code>
 net.ipv4.ip_local_port_range = 1024 65000 net.ipv4.ip_local_port_range = 1024 65000
-net.ipv4.tcp_keepalive_time = 1800+net.ipv4.tcp_keepalive_time = 300
 </code> </code>
  
 +==== チューニングの反映 ====
 +<code>
 +$ sudo reboot
 +</code>
 ===== 初期設定のバックアップ ===== ===== 初期設定のバックアップ =====
  初期状態に戻すことを可能にするために、以下のコマンドを実行してディレクトリのバックアップを行う。  初期状態に戻すことを可能にするために、以下のコマンドを実行してディレクトリのバックアップを行う。
 <code> <code>
-$ sudo cp -/etc/dirsrv /etc/dirsrv.org+$ sudo cp -rf /etc/dirsrv /etc/dirsrv.org
 </code> </code>
 ===== setup-ds-admin.pl の実行 ===== ===== setup-ds-admin.pl の実行 =====
行 90: 行 102:
 </code> </code>
 セットアップを続行する場合は、そのまま Enter キーを入力する。 セットアップを続行する場合は、そのまま Enter キーを入力する。
-<code> 
-============================================================================== 
-BY SETTING UP AND USING THIS SOFTWARE YOU ARE CONSENTING TO BE BOUND BY 
-AND ARE BECOMING A PARTY TO THE AGREEMENT FOUND IN THE 
-LICENSE.TXT FILE. IF YOU DO NOT AGREE TO ALL OF THE TERMS 
-OF THIS AGREEMENT, PLEASE DO NOT SET UP OR USE THIS SOFTWARE. 
  
-Do you agree to the license terms? [no]: yes 
-</code> 
-ライセンス条件に同意する場合は yes と入力する。 
 <code> <code>
 ============================================================================== ==============================================================================
行 107: 行 110:
 environment. environment.
  
-389 Directory Server system tuning analysis version 10-AUGUST-2007.+389 Directory Server system tuning analysis version 23-FEBRUARY-2012.
  
-NOTICE : System is x86_64-unknown-linux2.6.35.9-64.fc14.x86_64 (2 processors).+NOTICE : System is x86_64-unknown-linux3.11.1-200.fc19.x86_64 (1 processor).
  
-NOTICE : The net.ipv4.tcp_keepalive_time is set to 7200000 milliseconds +Would you like to continue? [yes]: 
-(120 minutes).  This may cause temporary server congestion from lost +</code> 
-client connections.+通知のみなので、そのまま Enter キーを入力して続行する。
  
-WARNING: There are only 1024 file descriptors (hard limit) available, which 
-limit the number of simultaneous connections.   
- 
-WARNING: There are only 1024 file descriptors (soft limit) available, which 
-limit the number of simultaneous connections.   
- 
-Would you like to continue? [no]: yes 
-</code> 
-警告など表示されるが、セットアップを続行する場合は、yes と入力する。 
 <code> <code>
 ============================================================================== ==============================================================================
行 137: 行 131:
  
    3. Custom    3. Custom
-       Allows you to specify more advanced options. This is +       Allows you to specify more advanced options. This is
        recommended for experienced server administrators only.        recommended for experienced server administrators only.
  
 To accept the default shown in brackets, press the Enter key. To accept the default shown in brackets, press the Enter key.
  
-Choose a setup type [2]: +Choose a setup type [2]:
 </code> </code>
 セットアップタイプはデフォルトのまま Enter キーを入力して続行する。 セットアップタイプはデフォルトのまま Enter キーを入力して続行する。
 +
 <code> <code>
 ============================================================================== ==============================================================================
行 154: 行 149:
 To accept the default shown in brackets, press the Enter key. To accept the default shown in brackets, press the Enter key.
  
-Computer name [monster.fireball.local]:+Warning: This step may take a few minutes if your DNS servers 
 +can not be reached or if DNS is not configured correctly.  If 
 +you would rather not wait, hit Ctrl-C and run this program again 
 +with the following command line option to specify the hostname: 
 + 
 +    General.FullMachineName=your.hostname.domain.name 
 + 
 +Computer name [green-ds.fireball.local]:
 </code> </code>
 コンピュータ名はデフォルトのまま Enter キーを入力して続行する。 コンピュータ名はデフォルトのまま Enter キーを入力して続行する。
 +
 <code> <code>
 +
 ============================================================================== ==============================================================================
 The servers must run as a specific user in a specific group. The servers must run as a specific user in a specific group.
行 169: 行 173:
 system utilities. system utilities.
  
-System User [nobody]: dirsrv +System User [nobody]: ldap 
-System Group [nobody]: dirsrv+System Group [nobody]: ldap
 </code> </code>
-サービスを特定のユーザー/グループの権限で実行するために、予め dirsrv ユーザーを作成しておき、それをここで指定する。+サービスを特定のユーザー/グループの権限で実行するために、予め ldapユーザーを作成しておき、それをここで指定する。 
 <code> <code>
 ============================================================================== ==============================================================================
行 197: 行 202:
 </code> </code>
 既存のディレクトリサーバーが存在しない場合は、Enter キーを入力して続行する。 既存のディレクトリサーバーが存在しない場合は、Enter キーを入力して続行する。
 +
 <code> <code>
 ============================================================================== ==============================================================================
行 204: 行 210:
  
 Configuration directory server Configuration directory server
-administrator ID [admin]:  +administrator ID [admin]: 
-Password: +Password:
 Password (confirm): Password (confirm):
 </code> </code>
-コンフィギュレーションディレクトリサーバーの管理者IDとパスワードを設定する。\\+ディレクトリサーバーの管理者IDとパスワードを設定する。\\
 管理者IDはデフォルトのまま Enter キーを入力し、任意のパスワードを入力する。\\ 管理者IDはデフォルトのまま Enter キーを入力し、任意のパスワードを入力する。\\
 +
 <code> <code>
 ============================================================================== ==============================================================================
行 226: 行 233:
 </code> </code>
 管理ドメインはデフォルトのまま Enter キーを入力して続行する。 管理ドメインはデフォルトのまま Enter キーを入力して続行する。
 +
 <code> <code>
 ============================================================================== ==============================================================================
行 234: 行 242:
 superuser, that port 389 is not in use. superuser, that port 389 is not in use.
  
-Directory server network port [389]: +Directory server network port [389]:
 </code> </code>
 ディレクトリサーバーのポート番号もデフォルトのまま Enter キーを入力して続行する。 ディレクトリサーバーのポート番号もデフォルトのまま Enter キーを入力して続行する。
 +
 <code> <code>
 ============================================================================== ==============================================================================
行 244: 行 253:
 as well as for other uses as a server instance identifier. as well as for other uses as a server instance identifier.
  
-Directory server identifier [monster]: +Directory server identifier [green-ds]: 
 </code> </code>
 ディレクトリサーバーの識別子もデフォルトのまま Enter キーを入力して続行する。 ディレクトリサーバーの識別子もデフォルトのまま Enter キーを入力して続行する。
 +
 <code> <code>
 ============================================================================== ==============================================================================
行 257: 行 267:
 Use the directory server utilities to create additional suffixes. Use the directory server utilities to create additional suffixes.
  
-Suffix [dc=fireball, dc=local]: +Suffix [dc=fireball, dc=local]:
 </code> </code>
 ディレクトリサーバーのサフィックスもデフォルトのまま Enter キーを入力して続行する。 ディレクトリサーバーのサフィックスもデフォルトのまま Enter キーを入力して続行する。
 +
 <code> <code>
 ============================================================================== ==============================================================================
行 275: 行 286:
 ディレクトリマネージャのDN(識別名)とパスワードを設定する。\\ ディレクトリマネージャのDN(識別名)とパスワードを設定する。\\
 DNはデフォルトのまま Enter キーを入力し、任意のパスワードを入力する。\\ DNはデフォルトのまま Enter キーを入力し、任意のパスワードを入力する。\\
 +
 <code> <code>
 ============================================================================== ==============================================================================
行 286: 行 298:
 will remember and which will not be used for anything else. will remember and which will not be used for anything else.
  
-Administration port [9830]: +Administration port [9830]:
 </code> </code>
 管理サーバーのポート番号もデフォルトのまま Enter キーを入力して続行する。 管理サーバーのポート番号もデフォルトのまま Enter キーを入力して続行する。
 +
 <code> <code>
 ============================================================================== ==============================================================================
行 294: 行 307:
 servers.  Enter No or go Back if you want to change something. servers.  Enter No or go Back if you want to change something.
  
-Are you ready to set up your servers? [yes]: +Are you ready to set up your servers? [yes]:
 </code> </code>
 問い合わせに対して Enter キーを入力して続行する。 問い合わせに対して Enter キーを入力して続行する。
 +
 <code> <code>
 Creating directory server . . . Creating directory server . . .
-Your new DS instance 'monster' was successfully created.+Your new DS instance 'green-nas' was successfully created.
 Creating the configuration directory server . . . Creating the configuration directory server . . .
 Beginning Admin Server creation . . . Beginning Admin Server creation . . .
行 312: 行 326:
 Admin server was successfully created, configured, and started. Admin server was successfully created, configured, and started.
 Exiting . . . Exiting . . .
-Log file is '/tmp/setupF6cGLQ.log' +Log file is '/tmp/setupwakfkC.log'
 </code> </code>
 ディレクトリサーバーの作成、管理サーバーの構成が行われて、サービスが起動される。 ディレクトリサーバーの作成、管理サーバーの構成が行われて、サービスが起動される。
 +===== サービス自動起動設定 =====
 +<code>
 +$ sudo systemctl enable dirsrv-admin.service
 +$ sudo systemctl enable dirsrv@green-ds.service
 +</code>
 +
 +===== firewall設定 =====
 +<code>
 +$ sudo firewall-cmd --permanent --add-service=ldap
 +$ sudo firewall-cmd --permanent --add-service=ldaps
 +$ sudo firewall-cmd --permanent --add-port=9830/tcp
 +$ sudo firewall-cmd --reload
 +</code>
 +<code>
 +$ sudo firewall-cmd --list-services
 +ipp-client mdns ldaps dhcpv6-client ldap
 +$ sudo firewall-cmd --list-ports
 +9830/tcp
 +</code>
 +
 ===== ディレクトリサーバーと管理サーバーの起動確認 ===== ===== ディレクトリサーバーと管理サーバーの起動確認 =====
  以下のコマンドを実行してプロセスが起動していることを確認する。  以下のコマンドを実行してプロセスが起動していることを確認する。
 <code> <code>
-ps ax | grep dirsrv +ps aux | grep ldap 
- 7604        Sl     0:01 ./ns-slapd -D /etc/dirsrv/slapd-monster -i /var/run/dirsrv/ +ldap      1104  0.1  1.0 1090784 20536       Sl   16:03   0:07 /usr/sbin/ns-slapd -D /etc/dirsrv/ 
-slapd-monster.pid -w /var/run/dirsrv/slapd-monster.startpid +slapd-green-ds -i /var/run/dirsrv/slapd-green-ds.pid -w /var/run/dirsrv/slapd-green-nas.startpid 
- 7817 ?        Ss     0:00 /usr/sbin/httpd.worker -k start -f /etc/dirsrv/admin-serv/httpd.conf +ldap      1190  0.0  0.3 772224  6428 ?        Sl   16:04   0:00 /usr/sbin/httpd -k start -f 
- 7818 ?        S      0:00 /usr/sbin/httpd.worker -k start -f /etc/dirsrv/admin-serv/httpd.conf + /etc/dirsrv/admin-serv/httpd.conf
- 7819 ?        Sl     0:00 /usr/sbin/httpd.worker -k start -f /etc/dirsrv/admin-serv/httpd.conf +
- 8542 pts/1    S+     0:00 grep --color=auto dirsrv+
 </code> </code>
 ^  プロセスの説明  ^^ ^  プロセスの説明  ^^
行 337: 行 368:
 </code> </code>
  
-===== サービ自動起動設定 ===== +===== Directory Server インタンスの削除 =====
- CentOSが起動するときに、ディレクトリサーバーと管理サーバーを自動起動するには、以下のコマンドにてサービスの設定を on にしておく。+
 <code> <code>
-# chkconfig dirsrv on +$ sudo remove-ds.pl -i slapd-instancename 
-# chkconfig dirsrv-admin on+</code> 
 +===== トラブルシューティング ===== 
 +==== dirsrv-admin.service が起動しない ==== 
 +ステータスを確認すると、以下のエラーが出力されている。 
 +<code> 
 +$ sudo systemctl status dirsrv-admin.service 
 +</code> 
 +<code> 
 +PID file /var/run/dirsrv/admin-serv.pid not readable (yet?) after start. 
 +dirsrv-admin.service never wrote its PID file. Failing. 
 +Failed to start 389 Administration Server.. 
 +Unit dirsrv-admin.service entered failed state. 
 +</code> 
 + 
 +[[https://fedorahosted.org/389/ticket/47429|#47429 (dirsrv fails to start due to incorrect /var/run/lock lines in tmpfiles.d) – 389 Project]]のバグの可能があるので、以下のファイルを確認する。 
 +<code> 
 +$ cat /etc/tmpfiles.d/dirsrv-blue-ds.conf  
 +</code> 
 +<code> 
 +d /var/dirsrv 0770 ldap ldap 
 +d /var/lock/dirsrv 0770 ldap ldap 
 +d /var/lock/dirsrv/slapd-blue-ds 0770 ldap ldap 
 +</code> 
 + 
 +/var/run/dirsrv の記載が存在しない場合は追記する。 
 +<code> 
 +$ sudo vi /etc/tmpfiles.d/dirsrv-blue-ds.conf  
 +</code> 
 +<code> 
 +d /var/dirsrv 0770 ldap ldap 
 +d /var/run/dirsrv 0770 ldap ldap <- 追記 
 +d /var/lock/dirsrv 0770 ldap ldap 
 +d /var/lock/dirsrv/slapd-blue-ds 0770 ldap ldap 
 +</code> 
 + 
 +再起動する。 
 +<code> 
 +$ sudo reboot
 </code> </code>
  
行 348: 行 415:
 [[http://gihyo.jp/admin/serial/01/ldap/0013?page=1|そろそろLDAPにしてみないか?:第13回 LDAPで管理するメールサーバ|gihyo.jp - gihyo.jp]]\\ [[http://gihyo.jp/admin/serial/01/ldap/0013?page=1|そろそろLDAPにしてみないか?:第13回 LDAPで管理するメールサーバ|gihyo.jp - gihyo.jp]]\\
 [[http://japan.internet.com/linuxtutorial/20060929/2.html|Fedora Directory Server を使って簡単に LDAP 構築―パート2――2 - japan.internet.com]]\\ [[http://japan.internet.com/linuxtutorial/20060929/2.html|Fedora Directory Server を使って簡単に LDAP 構築―パート2――2 - japan.internet.com]]\\
 +[[http://directory.fedoraproject.org/wiki/FDS_Setup|389 Directory Server (Open Source LDAP)]]\\
  • linux/389-directory-server.1380693572.txt.gz
  • 最終更新: 2019/05/18 02:23
  • (外部編集)