1、安装apache
2、安装mysql
# rpm -ivh MySQL-server-community-5.0.67-0.rhel4.i386.rpm
# rpm -ivh MySQL-client-community-5.0.67-0.rhel4.i386.rpm
# rpm -ivh MySQL-devel-community-5.0.67-0.rhel4.i386.rpm
# netstat -nl 查看 3306端口是否起来
# mysql -u root -p 登陆mysql数据库,测试是否正常。
3、安装daemontools
# cd /home/qmail-install/
# tar -zxvf /home/qmail-install/daemontools-0.76.tar.gz
# cd admin/daemontools-0.76
# patch -p1 < /home/qmail-install/netqmail-1.06/other-patches/daemontools-0.76.errno.patch
# package/install
///验证daemontools已经正常运行///
# ps ax | grep svscan
4、安装ucspi-tcp
# cd /home/qmail-install
# tar -zvxf ucspi-tcp-0.88.tar.gz
# cd ucspi-tcp-0.88
# patch -p1 < /home/qmail-install/ucspi-tcp-0.88.a_record.patch
# patch -p1 < /home/qmail-install/ucspi-tcp-0.88.errno.patch
# make
# make setup check
5、安装qmail
# groupadd nofiles
# useradd -g nofiles -d /var/qmail/alias -s /bin/false alias
# useradd -g nofiles -d /var/qmail -s /bin/false qmaild
# useradd -g nofiles -d /var/qmail -s /bin/false qmaill
# useradd -g nofiles -d /var/qmail -s /bin/false qmailp
# groupadd qmail
# useradd -g qmail -d /var/qmail -s /bin/false qmailq
# useradd -g qmail -d /var/qmail -s /bin/false qmailr
# useradd -g qmail -d /var/qmail -s /bin/false qmails
# mkdir /var/qmail/
# cd /home/qmail-install/netqmail-1.06
///打qmail-toaster-0.8版本,0.9版本里面多qmail-dk的东东,还需要其他补丁///
# patch < /home/qmail-install/qmail-toaster-0.8.3.patch
# make
# make setup check
# ./config-fast eworldchina.cn
# cd /var/qmail/alias
# touch .qmail-postmaster .qmail-mailer-daemon .qmail-root #设置postemaster mailer, root 邮件帐户
# chmod 644 /var/qmail/alias/.qmail*
# echo ./Maildir/ >/var/qmail/control/defaultdelivery
###turn on mfcheck,check that the envelope sender has a dns entry#####
# echo 1 > /var/qmail/control/mfcheck
###turn on SPF checking,check that the Sender Address Forgery#####
# echo 3 > /var/qmail/control/spfbehavior
///创建服务/////
# mkdir -p /var/qmail/supervise/qmail-send/log
# mkdir -p /var/qmail/supervise/qmail-smtpd/log
# mkdir -p /var/qmail/supervise/qmail-pop3d/log
# mkdir -p /var/qmail/supervise/qmail-pop3ds/log
# cp /home/qmail-install/toaster-scripts-0.9.1/send.run /var/qmail/supervise/qmail-send/run
# cp /home/qmail-install/toaster-scripts-0.9.1/send.log.run /var/qmail/supervise/qmail-send/log/run
# cp /home/qmail-install/toaster-scripts-0.9.1/smtpd.run /var/qmail/supervise/qmail-smtpd/run
# cp /home/qmail-install/toaster-scripts-0.9.1/smtpd.log.run /var/qmail/supervise/qmail-smtpd/log/run
# cp /home/qmail-install/toaster-scripts-0.9.1/pop3d.run /var/qmail/supervise/qmail-pop3d/run
# cp /home/qmail-install/toaster-scripts-0.9.1/pop3d.log.run /var/qmail/supervise/qmail-pop3d/log/run
# cp /home/qmail-install/toaster-scripts-0.9.1/pop3ds.run /var/qmail/supervise/qmail-pop3ds/run
# cp /home/qmail-install/toaster-scripts-0.9.1/pop3ds.log.run /var/qmail/supervise/qmail-pop3ds/log/run
# echo 20 > /var/qmail/control/concurrencyincoming
# chmod 644 /var/qmail/control/concurrencyincoming
# chmod 755 /var/qmail/supervise/qmail-send/run
# chmod 755 /var/qmail/supervise/qmail-send/log/run
# chmod 755 /var/qmail/supervise/qmail-smtpd/run
# chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
# chmod 755 /var/qmail/supervise/qmail-pop3d/run
# chmod 755 /var/qmail/supervise/qmail-pop3d/log/run
# chmod 755 /var/qmail/supervise/qmail-pop3ds/run
# chmod 755 /var/qmail/supervise/qmail-pop3ds/log/run
# mkdir -p /var/log/qmail/smtpd
# mkdir -p /var/log/qmail/pop3d
# mkdir -p /var/log/qmail/pop3ds
# chown -R qmaill /var/log/qmail
////启动脚本////
# cp /home/qmail-install/toaster-scripts-0.9.1/rc /var/qmail/
# cp /home/qmail-install/toaster-scripts-0.9.1/qmailctl /var/qmail/bin/
# chmod 755 /var/qmail/rc
# chmod 755 /var/qmail/bin/qmailctl
# ln -s /var/qmail/bin/qmailctl /usr/bin
# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
# ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
///用daemontools来启动qmail-send和qmail-smtpd ///
# ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
///启动,停止,重启,查看队列等///
# qmailctl start|stop|restart|doqueue|flush|reload|stat|pause|cont|cdb|queue|help
///检查服务///
# netstat -an | grep 25
# ps -ef | grep qmail
# ps -efl | grep "service errors" | grep -v grep
6、安装Vpopmail
# groupadd -g 89 vchkpw
# useradd -u 89 -g vchkpw -d /home/vpopmail vpopmail
# mkdir -p /home/vpopmail/etc
///设置默认域///
# echo "eworldchina.cn" > /home/vpopmail/etc/defaultdomain
///设置smtp规则///
# echo '127.0.0.1:allow,RELAYCLIENT=""' > /home/vpopmail/etc/tcp.smtp
# cd /home/vpopmail/etc/
# tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp
///设置mysql信息///
# echo "localhost|0|vpopuser|vpoppwd|vpopmail" > /home/vpopmail/etc/vpopmail.mysql
# chmod 640 /home/vpopmail/etc/vpopmail.mysql
# chown -R vpopmail.vchkpw /home/vpopmail/etc
///在mysql里添加vpopmail的账户///
# mysql -u root
mysql> CREATE DATABASE vpopmail;
mysql> GRANT select,insert,update,delete,create,drop ON vpopmail.* TO IDENTIFIED BY 'vpoppwd';
mysql> flush privileges;
mysql> quit
///安装vpopmail///
# cd /home/qmail-install/
# tar zxvf vpopmail-5.4.22.tar.gz
# cd vpopmail-5.4.22
# ./configure \
--disable-clear-passwd \
--enable-auth-module=mysql \
--enable-incdir=/usr/include/mysql/ \
--enable-libdir=/usr/lib/mysql/ \
--enable-tcpserver-file=/home/vpopmail/etc/tcp.smtp \
--enable-qmaildir=/var/qmail \
--enable-ip-alias-domains=n \
--disable-many-domains \
--enable-sqwebmail-pass=y \
--enable-valias=y \
--enable-logging=y
# make
# make install-strip
///vpopmail启动脚本///
# cp /home/qmail-install/toaster-scripts-0.9.1/vpopmailctl /var/qmail/bin/
# ln -s /var/qmail/bin/vpopmailctl /usr/bin/
# chmod 755 /var/qmail/bin/vpopmailctl
# ln -s /var/qmail/supervise/qmail-pop3d /service
# ln -s /var/qmail/supervise/qmail-pop3ds /service
///启动,停止,重启,查看队列等 ///
# vpopmailctl start|stop|restart|stat|pause|cont|help
///检查服务///
# netstat -an | grep 110
# ps -ef | grep qmail
# ps -efl | grep "service errors" | grep -v grep
7、安装autorespond
# cd /home/qmail-install/
# tar -zxvf autorespond-2.0.5.tar.gz
# cd autorespond-2.0.5
# make
# make install
8、安装ezmlm
# cd /home/qmail-install/
# tar -zxvf ezmlm-0.53.tar.gz
# tar -zxvf ezmlm-idx-0.42.tar.gz
# cp -rf ezmlm-idx-0.42/* ezmlm-0.53/
# cd ezmlm-0.53
# patch # chmod u+x makelang
# make
# make man
# make ch_GB
# make setup
9、安装cmd5checkpw
smtp-auth的设置
1.修改vchkpw的属性
# chmod 6755 /home/vpopmail/bin/vchkpw
2.下载安装cmd5checkpw
# tar zxvf cmd5checkpw-0.22.tar.gz
# cd cmd5checkpw-0.22
# mkdir -p /usr/man/man8
# make
# make install
///注意,因为使用vpopmail,所以checkpassword不用安装。///
10、安装qmailadmin
# cd /home/qmail-install/
# tar -zxvf qmailadmin-1.2.11.tar.gz
# cd qmailadmin-1.2.11
# ./configure \
--enable-htmldir=/usr/local/apache2/htdocs \
--enable-cgibindir=/usr/local/apache2/cgi-bin \
--enable-vpopuser=vpopmail \
--enable-autoresponder-bin=/usr/bin \
--enable-ezmlmdir=/usr/local/bin/ezmlm \
--enable-maxusersperpage=20 \
--enable-maxaliasesperpage=20 \
--enable-modify-quota \
--disable-ezmlm-mysql \
--disable-help \
--enable-domain-autofill
# make
# make install-strip
# cd /usr/local/share/qmailadmin/lang
# mv en en.bak
# cp zh-cn en
11、安装sqwebmail
# tar -xvf sqwebmail-4.0.7.tar
# cd sqwebmail-4.0.7.tar
# ./configure \
--prefix=/var/qmail/webmail \
--enable-webpass=vpopmail \
--enable-cgibindir=/usr/local/apache1/cgi-bin/ \
--enable-imagedir=/usr/local/apache1/htdocs/images/sqwebmail \
--enable-imageurl=/images/sqwebmail/
--enable-mimetypes=/usr/local/apache1/htdocs/ \
--enable-unicode=gb2312 \
--without-authpam \
--without-authpwd \
--without-authshadow \
--without-authldap \
--without-authuserdb \
--with-authvchkpw \
--with-authdaemon
# make configure-check
# make
# make install-strip
# make install-configure
# /var/qmail/webmail/libexec/authlib/authdaemond start
# /var/qmail/webmail/libexec/sqwebmaild.rc start
# echo "/var/qmail/webmail/libexec/authlib/authdaemond start" >> /etc/rc.local
# echo "/var/qmail/webmail/libexec/sqwebmaild.rc start" >> /etc/rc.local
阅读(1514) | 评论(0) | 转发(0) |