# tar zxvf openldap-stable-20050429.tgz
# cd openldap-2.2.26
# ./configure --prefix=/usr/local/openldap --enable-ldbm=yes --enable-bdb=no --enable-ipv6=no
# make depend
# make
# make test
# make install
# wget http://jaist.dl.sourceforge.net/ ... mm-0.9.7-rc1.tar.gz
# tar zxvf jamm-0.9.7-rc1.tar.gz
# cp jamm-0.9.7-rc1/src/schema/jamm.schema /usr/local/openldap/etc/openldap/schema/
先获得rootpw的加密密码,注意每次都不一样。你也可以用明文的
# /usr/local/openldap/sbin/slappasswd
New password: 12345
Re-enter new password: 12345
{SSHA}eBmoJWzMhMGgC48iqHHQyX4Q4CGhzZxO
# vi /usr/local/openldap/etc/openldap/slapd.conf
include /usr/local/openldap/etc/openldap/schema/core.schema
include /usr/local/openldap/etc/openldap/schema/cosine.schema
include /usr/local/openldap/etc/openldap/schema/nis.schema
include /usr/local/openldap/etc/openldap/schema/jamm.schema
allow bind_v2
pidfile /usr/local/openldap/var/run/slapd.pid
argsfile /usr/local/openldap/var/run/slapd.args
database ldbm
directory /usr/local/openldap/var/openldap-data
suffix "dc=test,dc=com"
rootdn "cn=Manager,dc=test,dc=com"
rootpw {SSHA}eBmoJWzMhMGgC48iqHHQyX4Q4CGhzZxO
#rootpw 12345
index objectClass pres,eq
index mail,cn eq,sub
access to dn.regex=".*,jvd=([^,]+),o=hosting,dc=test,dc=com"
attr=userPassword
by self write
by group/jammPostmaster/roleOccupant.expand="cn=postmaster,jvd=$1,o=hosting,dc=test,dc=com" write
by anonymous auth
by * none
access to dn.regex=".*jvd=([^,]+),o=hosting,dc=test,dc=com"
by self write
by group/jammPostmaster/roleOccupant.expand="cn=postmaster,jvd=$1,o=hosting,dc=test,dc=com" write
by * read
access to *
by * read
启动ldap
# /usr/local/openldap/libexec/slapd -d 256
出现slapd starting说明启动成功了,建议调试的时候以这种方式启动dlap
# vi /usr/local/openldap/etc/openldap/base.ldif
dn: dc=test, dc=com
objectClass: top
objectClass: domain
domainComponent: test
dn: cn=Manager, dc=test, dc=com
objectClass: top
objectClass: organizationalRole
cn: Manager
dn: o=hosting, dc=test, dc=com
objectClass: top
objectClass: organization
o: hosting
# /usr/local/openldap/bin/ldapadd -x -D "cn=Manager,dc=test,dc=com" -W -f /usr/local/openldap/etc/openldap/base.ldif
Enter LDAP Password:12345
adding new entry "dc=test, dc=com"
adding new entry "cn=Manager, dc=test, dc=com"
adding new entry "o=hosting, dc=test, dc=com"
2.安装cyrus-sasl 2.1.21
as4默认已经安装了,给它改个文件名吧,如果把rpm包删除之后配置跟我的肯定不一样
# mv /usr/lib/sasl /usr/lib/sasl.OFF
# mv /usr/lib/sasl2 /usr/lib/sasl2.OFF
编译安装cyrus-sasl2.1.21
# wget ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.21.tar.gz
# tar jxvf maildrop-1.8.1.tar.bz2
# cd maildrop-1.8.1
# ./configure \
--prefix=/usr/local/maildrop \
--enable-sendmail=/usr/sbin/sendmail \
--enable-trusted-users='root vmail' \
--enable-syslog=1 \
--enable-maildirquota \
--enable-maildrop-uid=5000 \
--enable-maildrop-gid=5000 \
--with-trashquota \
--with-dirsync
# make
# make install
# cp /usr/local/maildrop/bin/maildrop /usr/bin
# chmod a+rx /usr/bin/maildrop
运行maildrop -v应该有如下提示信息:
maildrop 1.8.0 Copyright 1998-2004 Double Precision, Inc.
GDBM extensions enabled.
Courier Authentication Library extension enabled.
Maildir quota extension enabled.
This program is distributed under the terms of the GNU General Public
License. See COPYING for additional information.
新建/etc/maildroprc文件
# vi /etc/maildroprc
logfile "/var/mailbox/maildrop.log"
to "$HOME/$DEFAULT"
# chmod a+r /etc/maildroprc
配置Postfix
# vi /etc/postfix/main.cf
virtual_transport = maildrop
maildrop_destination_recipient_limit = 1
# vi /etc/postfix/master.cf
maildrop unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/local/maildrop/bin/maildrop -w 90 -d ${recipient}
7.管理工具
安装apache 2.0.54
# wget http://apache.freelamp.com/httpd/httpd-2.0.54.tar.bz2
# tar jxvf httpd-2.0.54.tar.bz2
# cd httpd-2.0.54
# ./configure --prefix=/usr/local/apache
# make
# make install
设置自启动
# cp support/apachectl /etc/init.d/httpd
修改/etc/init.d/httpd
# vi /etc/init.d/httpd (前面部分修改成这样)
#!/bin/sh
#
# Startup script for the Apache Web Server
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /usr/local/apache/log/httpd.pid
# config: /usr/local/apache/conf/httpd.conf
# chkconfig --add httpd
# chmod 755 /etc/init.d/httpd
# chkconfig httpd on
# vi /usr/local/apache/conf/httpd.conf
DocumentRoot "/var/www"
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all