红联Linux门户
Linux帮助

RedHat 9.0下安装igenus实录

发布时间:2006-01-21 09:53:08来源:红联作者:ABC
[文章导读]安装igenus bluelotus 2003.06.16 Redhat9.0+Qmail+smtp-auth+Vpopmail+MySQL+Igenus……

在REDHAT9.0下安装igenus bluelotus 2003.06.16 Redhat9.0+Qmail+smtp-auth+Vpopmail+MySQL+Igenus,实例:http://0874.cn/mail

一、安装环境 及准备工作

安装Redhat9.0,安装时选取安装apache、php、mysql,可省去以后自已编译安装的麻烦,mysql要注意选取mysql-devel开发包,mysql的头文件和库文件分别在/usr/include/mysql和/usr/lib/mysql。

安装完Redhat9.0后,修改/etc/httpd/conf/httpd.conf,使web服务正常启用,为mysql添加root用户的密码。如果设置了防火墙,要打开服务器的smtp 25和pop3 110两个端口。

二、安装ucspi-tcp-0.88

1.下载相应软件及补丁,由于redhat9.0的glibc的版本问题,必须打补丁才能正常编译。wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz

wget http://qmail.te8.com/rpms/glibc-2.3.1/ucspi-tcp-0.88.a_record.patch

wget http://qmail.te8.com/rpms/glibc-2.3.1/ucspi-tcp-0.88.errno.patch

wget http://qmail.te8.com/rpms/glibc-2.3.1/ucspi-tcp-0.88.nobase.patch

2.安装ucspi-tcp-0.88#tar zxvf ucspi-tcp-0.88.tar.gz

#cd ucspi-tcp-0.88

#patch -p1 < ../ucspi-tcp-0.88.a_record.patch

#patch -p1 < ../ucspi-tcp-0.88.errno.patch

#patch -p1 < ../ucspi-tcp-0.88.nobase.patch

#make

#make setup check

三、安装qmail

1.下载软件及补丁:wget http://cr.yp.to/software/qmail-1.03.tar.gz

wget http://www.ckdhr.com/ckd/qmail-103.patch

wget http://www.qmail.org/qmailqueue-patch

wget http://www.shupp.org/patches/qmail-maildir++.patch

wget http://qmail.te8.com/rpms/glibc-2.3.1/qmail-1.03.errno.patch

wget http://qmail.te8.com/rpms/glibc-2.3.1/qmail-1.03.qmail-local.patch

wget http://members.elysium.pl/brush/qmail-smtp-auth/dist/qmail-smtpd-auth-0.31.tar.gz

2.建立目录:# mkdir /var/qmail

# mkdir /var/qmail/alias

3.建组及用户:# groupadd nofiles

# groupadd qmail

# useradd alias -g nofiles -d /var/qmail/alias -s /nonexistent

# useradd qmaild -g nofiles -d /var/qmail -s /nonexistent

# useradd qmaill -g nofiles -d /var/qmail -s /nonexistent

# useradd qmailp -g nofiles -d /var/qmail -s /nonexistent

# useradd qmailq -g qmail -d /var/qmail -s /nonexistent

# useradd qmailr -g qmail -d /var/qmail -s /nonexistent

# useradd qmails -g qmail -d /var/qmail -s /nonexistent

4.打补丁及编绎安装qmail#tar zxvf qmail-1.03.tar.gz

#tar zxvf qmail-smtpd-auth-0.31.tar.gz

#cp qmail-smtpd-auth-0.31/base64.* qmail-1.03 //安装smtp-auth补丁,支持smtp认证

#patch -d qmail-1.03 < qmail-smtpd-auth-0.31/auth.patch

#cd qmail-1.03

#patch -p1 < ../qmail-103.patch

#patch -p1 < ../qmailqueue-patch

#patch -p1 < ..qmail-maildir++.patch

#patch -p1 < ..qmail-1.03.errno.patch

#patch -p1 < ..qmail-1.03.qmail-local.patch

#vi qmail-smtpd.c //将函数straynewline中的451改为553

# make setup check

# ./config-fast test.mydomain.com
5.添加别名用户:


# touch /var/qmail/alias/.qmail-root

# touch /var/qmail/alias/.qmail-postmaster

# touch /var/qmail/alias/.qmail-mailer-daemon

6.如果存在postfix和sendmail,停用现在的mail服务#/etc/rc.d/init.d/sendmail stop

#cp /var/qmail/bin/sendmail /usr/sbin/qmail.sendmail

#rm -f /etc/alternative/mta

#ln -s /usr/sbin/qmail.sendmail /etc/alternative/mta

Redhat9.0已经考虑到了使用其它邮件服务器代替sendmail的情况,因为本身就提供postfix和sendmail两种选择。

四、安装vpopmail

1.下载vpopmail的稳定版

wget http://www.inter7.com/vpopmail/vpopmail-5.2.1.tar.gz

2.建立目录:

#mkdir /home/vpopmail

#mkdir /home/vpopmail/etc

3.添加用户和组:

#groupadd vchkpw

#useradd -g vchkpw vpopmail

4.添加mysql的vpopmail用户,用于操作vpopmail数据库

#mysql -u root -p //进入mysql命令行

mysql> grant all on vpopmail.* to vpopmail@localhost identified by "密码";

5.编译安装vpopmail

#tar zxvf vpopmail-5.2.1.tar.gz

#cd vpopmail-5.2.1

#vi vmysql.h

/* =========================== vmysql.h ============================== */

#define MYSQL_UPDATE_SERVER "localhost" (mysql服务器名)

#define MYSQL_UPDATE_USER "vpopmail" (用户名)

#define MYSQL_UPDATE_PASSWD "12345678" (改成你设置的密码)

#define MYSQL_READ_SERVER "localhost" (mysql服务器名)

#define MYSQL_READ_USER "vpopmail" (用户名)

#define MYSQL_READ_PASSWD "12345678" (改成你设置的密码)

/*==================================================================*/6.创建tcp.smtp文件(或者使用/etc/tcp.smtp)

# vi /home/vpopmail/etc/tcp.smtp

/*==================== tcp.smtp ================================ */

127.0.0.1:allow,RELAYCLIENT=""

:allow

/*========================================================== */

#cd /home/vpopmail/etc

#tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp

7.进行编译:# ./configure \下面是我使用的参数

--prefix=/home/vpopmail \指定安装路径

--enable-mysql=y \是否应用Mysql数据库

--enable-incdir=/usr/include/mysql \Mysql数据库include文件所在目录

--enable-libdir=/usr/lib/mysql \Mysql数据库lib文件所在目录

--enable-default-domain=mydomain.com \定义虚拟域名

--enable-passwd=n \是否使用系统密码验证方式

--enable-defaultquota=52428800s \定义缺省邮箱大小,10485760为10MB,20971520为20MB,52428800s为50MB

--enable-tcprules-prog=/usr/local/bin/tcprules \指定tcprules目录

--enable-tcpserver-file=/home/vpopmail/etc/tcp.smtp \指定tcprules应用规则文件

--enable-vpopuser=vpopmail \vpopmail的用户

--enable-vpopgroup=vchkpw \vpopmail的组

--enable-ip-alias-domains=n \在虚拟域中允许通过反向IP地址查找虚拟域名

# make

# make install-strip

8.创建虚拟域

# cd /home/vpopmail/bin

# ./vadddomain 域名 (密码) (在mysql数据库vpopmail中自动生成vpopmail表单)

(如果使用与机器名相同的虚拟域名,应先生成一个其它的虚拟域名,不然会有问题,无法自动生成vpopmail数据库)

# ./vadduser 用户名 密码 (会自动往表vpopmail中添加用户数据,用户名要带域名,如demo@demo.com)

如果不成功的话,则必须先删除创建的域,./vdeldomain 域名

五、smtp-auth的设置

1.修改vchkpw的属性

#chmod 4755 vchkpw

#chown root.root vchkpw

如果使用带验证的smtp,smtp进程要调用密码验证程序,则必须要使用 setuid 和setgid。提高vchkpw的权限,才能完成setgid操作。

2.下载安装cmd5checkpwwget http://members.elysium.pl/brush/cmd5checkpw/dist/cmd5checkpw-0.22.tar.gz

#tar zxvf cmd5checkpw-0.22.tar.gz

#cd cmd5checkpw-0.22

#make

#make install

注意,因为使用vpopmail,所以checkpassword不用安装。


六、生成qmail的启动脚本


#cp /var/qmail/boot/home /var/qmail/rc

# vi /var/qmail/rc //对rc文件进行修改,以决定投送方式:

/* ================= rc =========================*/

#!/bin/sh

# Using splogger to send the log through syslog.

# Using dot-forward to support sendmail-style ~/.forward files.

# Using qmail-local to deliver messages to ~/Mailbox by default.

exec env - PATH="/var/qmail/bin:$PATH"

qmail-start ./Maildir/ splogger qmail &

/* ============================================*/

#vi /var/qmail/smtp //编辑smtp服务的启动脚本

/* ===================== smtp ============================= */

#!/bin/sh

QMAILDUID=qmaild

NOFILESGID=nofiles

/usr/local/bin/tcpserver -H -R -l 0 -t 1 -v -p -x /home/vpopmail/etc/tcp.smtp.cdb -u $QMAILDUID -g $NOFILESGID 0 smtp /var/qmail/bin/qmail-smtpd hostname /home/vpopmail/bin/vchkpw /bin/true /bin/cmd5checkpw /bin/true 2>&1 | /var/qmail/bin/splogger smtpd 3 &

/* ====================================================== */

#vi /var/qmail/pop3 //编辑pop3服务的启动脚本

/* ====================== pop3 =========================== */

#!/bin/sh

/usr/local/bin/tcpserver -H -R 0 pop3

/var/qmail/bin/qmail-popup hostname

/home/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir &

/* ===================================================== */

#chmod 755 /var/qmail/rc

#chmod 755 /var/qmail/smtp

#chmod 755 /var/qmail/pop3

七、运行qmail并测试#/var/qmail/rc

#/var/qmail/smtp

#/var/qmail/pop3

#ps aux | grep "qmail" //查看qmail的服务进程是否已完全正常启动

如果qmail已正常启动,用outlook测试qmail的smtp和pop3是否正常,注意由于vpopmail支持虚拟域名,所以在outlook中设置邮件帐号时,用户名后要加上域名,如demo@demo.com。smtp是带认证的,在outlook中也要作相应设置。建议先将qmail测试正常后再安装igenus,我在qmail正常工作后,安装igenus只用了10分钟,非常顺利。如果qmail出现问题,可查看mysql中的vpopmail数据库,/var/log下的mysqld和maillog日志记录,这样容易很快找出问题。

八、安装并运行igenus

1.到http://www.igenus.org下载最新的安装包,我用的是igenus_2_20030516_snap.tgz

#tar zxvf igenus_2_20030516_snap.tgz -C /var/www/html //redhat下apache的缺省document root

2.建temp文件夹

cd /var/www/html/igenus

mkdir temp

chmod -R 0755 temp

chown -R vpopmail:vchkpw temp

3.修改httpd.conf

#vi /etc/httpd/conf/httpd.conf

Group Apache

User Apache

修改为:

Group vchkpw

User vpopmail

4.修改config_inc.php文件

# cd /usr/local/apache/htdocs/igenus/config

# vi config_inc.php

/* =============== config_inc.php ==================== */

$CFG_BASEPATH = "/usr/local/apache/htdocs/igenus";

$CFG_MYSQL_HOST = 'localhost';

$CFG_MYSQL_USER = 'vpopmail';

$CFG_MYSQL_PASS = '12345678'; \改成你的密码

$CFG_MYSQL_DB = 'vpopmail';

$CFG_TEMP = $CFG_BASEPATh."/temp";

/* ============================================== */

5.重新编制Mysql数据库表格

#mysql -u root -p

mysql>use vpopmail;

mysql>alter table vpopmail drop primary key;

mysql>alter table vpopmail add column pw_id int(5) NOT NULL primary key auto_increment;

mysql>create table address

(

id int(11) unsigned NOT NULL auto_increment,

pw_id int(5) unsigned NOT NULL default '0',

name varchar(64) NOT NULL default '',

email varchar(128) NOT NULL default '',

UNIQUE KEY id (id),

KEY pw_id (pw_id)

) TYPE=MyISAM;

mysql>quit;

6.如果需要,用vadddomain和vadduser添加新域名和新用户。

最后打开浏览器,输入http://你的网站/igenus,说Good Luck!。
文章评论

共有 3 条评论

  1. 于 2006-10-16 02:04:52发表:

    INT MILITARY BUNKER play65 When suddenly theres a split in the road backgammon online Marty handed him his wallet after a moments hesitation online backgammon the broken windows and overall run-down worn-in look the place had held .

  2. 于 2006-10-01 11:47:40发表:

    The casinos advantage is lower with fewer decks in play But for now, play65 later the agent tossed his guitar case out of the room and slammed the backgammon online He stopped in the living room on the way to the kitchen His father online backgammon Whats in this stuff.

  3. 于 2006-08-04 07:25:23发表:

    Marty looked up facing the inevitable He might as well give his online casinos George stared at Biff who stared back angrily.