|
|

楼主 |
发表于 2005-11-21 08:58:11
|
显示全部楼层
1.
wget -t 0 -c http://downloads.sleepycat.com/db-4.4.16.tar.gz -b
2.
wget -t 0 -c ftp://ftp.openldap.org/pub/OpenL ... openldap-2.3.12.tgz -b
3.
tar -zxf db-4.4.16.tar.gz
4.
tar -zxf openldap-2.3.12.tgz
5.
cd db-4.4.16
6.
cp -r docs/ /var/www/html/docs/db/
7.
lynx http://localhost/docs/db/ref/build_unix/intro.html
Building for UNIX/POSIX systems
8.
cd ..
./db-4.4.16/dist/configure
9.
make
9.1.
libtool: link: `bt_compare.lo' is not a valid libtool object
make: *** [libdb-4.4.la] Error 1
9.1.1
若有如上错误请用.当然你可以
make realclean ; ./db-4.4.16/dist/configure ; ./db-4.4.16/dist/configure
10.
make install
这步不要忘记了哦
会产生/usr/local/BerkeleyDB.4.4/这个目录等
11.
/usr/local/BerkeleyDB.4.4/lib的库路径加到/etc/ld.so.conf文件内,添加完成后执行一次ldconfig,
此步如果提示数据库的版本不一致时请用locate找到原来的如我的
/usr/lib/libdb-4.2.so
/usr/lib64/libdb-4.2.so
将其mv改名即可.
12.
ldap+通讯录已OK,
具体的内容会补上的...
cd ../openldap-2.3.12/
env CPPFLAGS="-I/usr/local/BerkeleyDB.4.4/include" LDFLAGS="-L/usr/local/BerkeleyDB.4.4/lib" ./configure --prefix=/usr/local/openldap
13.
make depend ; make ; make test ; make install ;
14.
vi /usr/local/openldap/etc/openldap/slapd.conf
database bdb
suffix "dc=excelladeptech,dc=twcn"
rootdn "cn=peter,dc=excelladeptech,dc=twcn"
rootpw peterldap
15.
ls /usr/local/openldap/etc/openldap/schema/
README dyngroup.schema nis.schema
corba.schema inetorgperson.schema openldap.ldif
core.ldif inetorgperson.schema.old openldap.schema
core.schema java.schema ppolicy.schema
cosine.schema misc.schema
16.
将这些都仿这句加入到slapd.conf
include /usr/local/openldap/etc/openldap/schema/core.schema
cat /usr/local/openldap/etc/openldap/ldap.conf | grep BASE
BASE dc=excelladeptech,dc=twcn
17.
service ldap restart
Stopping slapd: [ OK ]
Warning: no db_recover available for /usr/local/openldap/var/openldap-data
Starting slapd (ldap): [FAILED]
(备注:不知道具体原因,现在启动我只能用
/usr/local/openldap/libexec/slapd
ps aux | grep slapd
root 29409 0.0 0.3 11368 2584 ? S 11:01 0:00 /usr/local/openldap/libexec/slapd
root 29413 0.0 0.1 3012 792 pts/1 S 11:01 0:00 grep slapd
有它就代表基本正常了.
18.
cat /etc/openldap/peter-unit.ldif
#root node
dn: dc=excelladeptech,dc=twcn
objectClass: dcObject
objectClass: organization
o: Excell&Adeptech Company
dc: excelladeptech
#the mail node
dn: ou=account,dc=excelladeptech,dc=twcn
objectClass: organizationalUnit
ou: account
#for Manager information
dn: cn=peter,dc=excelladeptech,dc=twcn
objectClass: organizationalRole
cn:peter
19.
和slapd.con中的dc=excelladeptech,dc=twcn要一樣哦,我就錯了幾次,看?磉是浮躁了.
备注:其上文件有两个空行必不可少,每行最后一行不得有空格,不然就乱掉了.
20.
ldapadd -x -D "cn=peter,dc=excelladeptech,dc=twcn" -W -f /etc/openldap/peter-unit.ldif
這個過程之前總碰到各種錯誤,要麽是.schema中有被注釋或者是有些沒被注釋的問題吧.
因為我們的目標只是一個通?錄故我們可以?量簡化ldif文件,
21.
cat /etc/openldap/wangjun.ldif
dn: cn=wangjun,dc=excelladeptech,dc=twcn
cn: wangjun
objectClass: inetorgperson
objectClass: person
sn: panye
mail: wangjun@at-scale.com
ldapadd -x -D "cn=peter,dc=excelladeptech,dc=twcn" -W -f /etc/openldap/wangjun.ldif
如無錯誤提示就用ldapsearch?砜纯葱Ч.
前提是訪問控制我們可以簡單的在slapd.conf加句這個
access to *
by * read
[root@shlinux schema]# ldapsearch -b "dc=excelladeptech,dc=twcn" -x
# extended LDIF
#
# LDAPv3
# base <dc=excelladeptech,dc=twcn> with scope sub
# filter: (objectclass=*)
# requesting: ALL
#
# excelladeptech.twcn
dn: dc=excelladeptech,dc=twcn
objectClass: dcObject
objectClass: organization
o: Excell&Adeptech Company
dc: excelladeptech
# account, excelladeptech.twcn
dn: ou=account,dc=excelladeptech,dc=twcn
objectClass: organizationalUnit
ou: account
# wangjun, excelladeptech.twcn
dn: cn=wangjun,dc=excelladeptech,dc=twcn
cn: wangjun
objectClass: inetOrgPerson
objectClass: person
sn: panye
mail: wangjun@at-scale.com
是不會感覺OK了呢?還不是很規範吧.
所以我們要將dn: cn=wangjun,dc=excelladeptech,dc=twcn
刪除掉,而且我們還要用中文,不然不能用到?施的技術是沒有太大的價值的.
ldapdelete -x -D "cn=peter,dc=excelladeptech,dc=twcn" -W "cn=wangjun,dc=excelladeptech,dc=twcn"
就OK了,備註pete是ldap的管理員哦
25.
加一個中文的哦
cat /etc/openldap/lizhijuan.ldif
dn: cn=lizhijuan,ou=account,dc=excelladeptech,dc=twcn
cn: lizhijuan
objectClass: inetorgperson
objectClass: person
sn: 李志娟
mail: lzj@mis.com
(備註:如果你是用中文簡繁體輸入的請使用
autogb < /tmp/123 > /etc/openldap/lizhijuan.ldif -i big5 -o utf8
ldapadd -x -D "cn=peter,dc=excelladeptech,dc=twcn" -W -f /etc/openldap/lizhijuan.ldif
導入OK了.
26.
辛苦了半天,是不是要體驗一下在windows的outlook express中設置看看效果呢?
(別鬧了,沒辦法畢竟客戶端用windows的多,有?際作用就好了)
工具->帳號-->目錄服務-->新增目錄服務-->
192.168.7.112
是要用這個目錄服務檢查地址
dc=excelladeptech,dc=twcn
當然我們可以用
ou=account,dc=excelladeptech,dc=twcn
差?是用
dc=excelladeptech,dc=twcn檢查的時候其下都可以找到,
用ou=account,dc=excelladeptech,dc=twcn只可以找到ou=account,dc=excelladeptech,dc=twcn下的,這就是ldif中dn的那一句的作用了.
dn: cn=lizhijuan,ou=account,dc=excelladeptech,dc=twcn
基本結束了,有時間細寫.
phpldapadmin
下載解壓到/var/www/html目錄下後
需要
php-xml
php-ldap
後
cp config.php.example config.php
就可以用
cn=peter,dc=excelladeptech,dc=twcn
去登錄管理了.
可在網頁上
ldap://192.168.7.112/dc=excelladeptech,dc=twcn??sub?
這樣按ctrl可連選去發送郵件了... |
|