database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
ㆍLDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
LDAP Q&A 1876 게시물 읽기
No. 1876
OpenLDAP으로 한글 값을 입력하고 싶습니다.
작성자
신재훈(chelsi)
작성일
2003-07-30 14:45
조회수
6,865

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

이 글에 대한 댓글이 총 2건 있습니다.

ldapadd 라는 command는 지정한 파일을 문자셋 변환없이 그대로 LDAP 에 적용합니다.

그러므로 님 께서 원하는 는 결과를 얻기 위해서는 소스 파일 즉 miso.ldif 를 ldap이 인식할수 있는 문자셋 코드로 변환하셔서 적용하셔야 합니다.

아님 java API를 이용하여 직접 값을 입력하시면 별도의 변환 과정없이 입력이 가능합니다.

그러나 대량의 데이터를 올릴때에는 한계가 있음으로 따로 문자셋 변환 모듈을 만드시는게 낳을듯 합니다.

 

게시판에서 UTF-8 으로 검색해 보세요...

jack님이 2003-07-30 16:20에 작성한 댓글입니다.

감사합니다.

 

값 인서트시 UTF-8로 변환해서 입력하니 아주 잘되는군요.. 감사합니다!

신재훈(chelsi)님이 2003-07-30 16:44에 작성한 댓글입니다.
[Top]
No.
제목
작성자
작성일
조회
1879LDAP Server CPU 사용량 증가 [4]
초보
2003-07-30
6047
1878LDAP과 VPN 연동 시 Duplication Error 발생 [1]
초보
2003-07-30
5434
1877Cyrus's SASL 설치시 에러..
한유수
2003-07-30
5724
1876OpenLDAP으로 한글 값을 입력하고 싶습니다. [2]
신재훈
2003-07-30
6865
1875인증 부분에 대한 질문입니다 [3]
최회숙
2003-07-29
6029
1874스키마 정의하려고 하는데요.... [1]
이상준
2003-07-29
5325
1873고수님들 봐주세요...DB에 관한... [5]
이상준
2003-07-28
5770
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2023 DSN, All rights reserved.
작업시간: 0.057초, 이곳 서비스는
	PostgreSQL v16.1로 자료를 관리합니다