이 절차를 통해 작성되는 LDIF 스크립트는 액세스 로그에 대해 다음 규칙을 설정합니다.
로그 수준 256의 로그 이벤트로, 버퍼 로그를 작성합니다(기본값).
로그는 매일 회전됩니다.
로그 파일 수를 최대 100개로 유지하고각 파일의 크기는 최대 500MB를 넘지 않도록 합니다.
3개월 이상 된 로그 파일은 만료됩니다.
빈 디스크 공간이 500MB 미만이 되면 가장 오래된 로그를 삭제합니다.
모든 로그 파일은 최대 20,000MB의 디스크 공간을 사용합니다.
스크립트를 만들어 액세스 로그를 관리합니다.
다음 내용이 있는 /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 |