LDAP에서 한글 값으로는 절대로... 입력이 되지 않는군요..
제가 무엇을 잘 못했는지 모르겠습니다...
LDAP에 한글을 입력해 보신 분은... 도움을 주시면 감사하겠습니다.
저번과 같은 에러가 난후 꾸준히 여러 가지 방법을 써보며
연구를 해보았지만 똑같이 한글 값은 인서트가 되지 않습니다.
제가 지금까지 한 작업들을 전부 첨부하여 보내겠습니다
바쁘신 시간을 내주셔서 조금만 도움을 주시면 감사하겠습니다.
상준님께서는 어떻게 slapd.conf를 구성하셨으며, 한글 값은 어떻게
추가하셨는지.. 궁금합니다.. 제가 무엇이 틀렸는지요?.....
------------------------------------------------------------------
1). 시스템 환경 설정
설치한 LDAP 버전 : openldap-2.1.21
설치한 BDB 버전 : BerkeleyDB.4.1
LDAP 설치 경로 : /usr/local/ldap
BDB 설치 경로 : /usr/local/BerkeleyDB.3.1
2)./usr/local/ldap/etc/slapd.conf
# $OpenLDAP: pkg/ldap/servers/slapd/slapd.conf,v 1.23.2.8 2003/05/24 23:19:14 kurt Exp $
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /usr/local/ldap/etc/openldap/schema/core.schema
include /usr/local/etc/openldap/schema/cosine.schema
include /usr/local/etc/openldap/schema/inetorgperson.schema
schemacheck off
# Define global ACLs to disable default read access.
# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org
pidfile /usr/local/ldap/var/slapd.pid
argsfile /usr/local/ldap/var/slapd.args
# Load dynamic backend modules:
# modulepath /usr/local/ldap/libexec/openldap
# moduleload back_bdb.la
# moduleload back_ldap.la
# moduleload back_ldbm.la
# moduleload back_passwd.la
# moduleload back_shell.la
# Sample security restrictions
# Require integrity protection (prevent hijacking)
# Require 112-bit (3DES or better) encryption for updates
# Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64
# Sample access control policy:
# Root DSE: allow anyone to read it
# Subschema (sub)entry DSE: allow anyone to read it
# Other DSEs:
# Allow self write access
# Allow authenticated users read access
# Allow anonymous users to authenticate
# Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
access to *
by * read
# if no access controls are present, the default policy is:
# Allow read by all
#
# rootdn can always write!
#######################################################################
# ldbm database definitions
#######################################################################
database bdb
suffix "dc=ldap, dc=miso, dc=com"
rootdn "cn=Manager, dc=ldap, dc=miso, dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw secret
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /usr/local/ldap/var/openldap-data
# Indices to maintain
#index objectClass eq
lastmod on
#index cn,sn,givenname,mail
index objectClass eq
index cn,sn,mail eq,sub
index departmentNumber eq
3) 값 추가 구문
# ldapadd -x -D "cn=Manager, dc=ldap,dc=miso, dc=com" -w secret -f ./test.ldif
4) test.ldif 파일 내용
dn: cn=test ou=netpia,dc=ldap,dc=miso,dc=com
objectClass: inetOrgPerson
objectClass : top
objectClass :organizationalunit
objectClass: dcObject
cn: test
sn:: 신재훈
mail: jhshin@netpia.com
5) 검색 화면
ldapsearch -x -b "dc=ldap,dc=miso,dc=com" "(objectclass=*)"
# extended LDIF
#
# LDAPv3
# base <dc=ldap,dc=miso,dc=com> with scope sub
# filter: (objectclass=*)
# requesting: ALL
#
# ldap.miso.com
dn: dc=ldap,dc=miso,dc=com
dc: ldap
objectClass: dcobject
# Manager, ldap.miso.com
dn: cn=Manager,dc=ldap,dc=miso,dc=com
cn: Manager
sn: Carter
mail: jerry@plainjoe.org
mail: gcarter@valinux.com
labeledURI: http://www.plainjoe.org/
roomNumber: 1234 Dudley Hall
departmentNumber: Engineering
telephoneNumber: 222-555-2345
pager: 222-555-6789
mobile: 222-555-1011
objectClass: inetOrgPerson
# people, ldap.miso.com
dn: ou=people,dc=ldap,dc=miso,dc=com
objectClass: top
objectClass: organizationalunit
ou: ldapuser
# Manager, people, ldap.miso.com
dn: cn=Manager,ou=people,dc=ldap,dc=miso,dc=com
objectClass: inetOrgPerson
cn: Manager
sn: shinjaehoon
mail: jhshin@netpia.com
# people1, ldap.miso.com
dn: ou=people1,dc=ldap,dc=miso,dc=com
objectClass: top
objectClass: organizationalunit
ou: ldapuser
# shin, people1, ldap.miso.com
dn: cn=shin,ou=people1,dc=ldap,dc=miso,dc=com
objectClass: inetOrgPerson
cn: shin
sn: sjh
mail: jhshin@netpia.com
# mail1, people1, ldap.miso.com
dn: cn=mail1,ou=people1,dc=ldap,dc=miso,dc=com
objectClass: inetOrgPerson
cn: mail1
sn: ShinJaeHoon
mail: jhshin@netpia.com
# mail2, people1, ldap.miso.com
dn: cn=mail2,ou=people1,dc=ldap,dc=miso,dc=com
objectClass: inetOrgPerson
cn: mail2
sn: vcXA58jG
mail: jhshin@netpia.com
# netpia, ldap.miso.com
dn: ou=netpia,dc=ldap,dc=miso,dc=com
objectClass: top
objectClass: organizationalunit
ou: netpia
# shin ou=netpia, ldap.miso.com
dn: cn=shin ou=netpia,dc=ldap,dc=miso,dc=com
objectClass: inetOrgPerson
objectClass: dcObject
cn: shin
sn: vcXA58jG
mail: jhshin@netpia.com
# search result
search: 2
result: 0 Success
# numResponses: 11
# numEntries: 10
6) 한글 값 추가시 에러
ldapadd -x -D "cn=Manager, dc=ldap,dc=miso, dc=com" -w secret -f ./miso.ldif
[root@ldap:/usr/local/ldap]# ldapadd -x -D "cn=Manager, dc=ldap,dc=miso, dc=com" -w secret -f ./hh.ldif
adding new entry "cn=Manager,ou=people,dc=ldap,dc=miso,dc=com"
ldapadd: update failed: cn=Manager,ou=people,dc=ldap,dc=miso,dc=com
ldap_add: Invalid syntax (21)
additional info: sn: value #0 invalid per syntax
|