この手順で作成する LDIF スクリプトによって、アクセスログに関して次の規則が定められます。
ログレベル 256 のイベントをログに記録し、バッファーログを作成します (デフォルト)。
ログを毎日ローテーションします。
各ファイル最大 500M バイトの、最大 100 のログファイルを保持します。
3 か月よりも前のログファイルは期限切れになります。
ディスク容量の空きが 500M バイトを下回ると古いログから削除します。
すべてのログファイルで最大 20,000M バイトのディスク容量を使用します。
アクセスログを管理するためのスクリプトを作成します。
次の内容の /var/tmp/logs-access.ldif ファイルを作成します。
dn: cn=config changetype: modify replace: nsslapd-accesslog-logging-enabled nsslapd-accesslog-logging-enabled: on - replace: nsslapd-accesslog-level nsslapd-accesslog-level: 256 - replace: nsslapd-accesslog-logbuffering nsslapd-accesslog-logbuffering: on - replace: nsslapd-accesslog-logrotationtime nsslapd-accesslog-logrotationtime: 1 - replace: nsslapd-accesslog-logrotationtimeunit nsslapd-accesslog-logrotationtimeunit: day - replace: nsslapd-accesslog-maxlogsize nsslapd-accesslog-maxlogsize: 500 - replace: nsslapd-accesslog-maxlogsperdir nsslapd-accesslog-maxlogsperdir: 100 - replace: nsslapd-accesslog-logexpirationtime nsslapd-accesslog-logexpirationtime: 3 - replace: nsslapd-accesslog-logexpirationtimeunit nsslapd-accesslog-logexpirationtimeunit: month - replace: nsslapd-accesslog-logmaxdiskspace nsslapd-accesslog-logmaxdiskspace: 20000 - replace: nsslapd-accesslog-logminfreediskspace nsslapd-accesslog-logminfreediskspace: 500 |
スクリプトを実行します。
# ldapmodify -h localhost -D 'cn=directory manager' \ -f /var/tmp/logs-access.ldif |
パスワードを入力します。
Enter bind password: Type the appropriate password modifying entry cn=config |