Chinaunix首页 | 论坛 | 博客
  • 博客访问: 586980
  • 博文数量: 129
  • 博客积分: 6240
  • 博客等级: 准将
  • 技术积分: 1765
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-18 15:42
文章分类

全部博文(129)

文章存档

2015年(1)

2012年(3)

2011年(6)

2010年(14)

2009年(105)

我的朋友

分类:

2009-03-18 16:35:28

[root@smtp:/home/vpopmail/domains] uname -rm
2.6.18-xenU-ec2-v1.0 x86_64

rpm -q httpd php php-mysql mysql mysql-server mysql-devel gdbm gdbm-devel openssl openssl-devel stunnel krb5-devel

yum install httpd php php-mysql mysql mysql-server mysql-devel gdbm-devel krb5-devel

service httpd start
service mysqld start
mysqladmin -u root password '0000'

service sendmail stop
rpm -e --nodeps sendmail

mkdir /home/pkg
cd /home

tar -zxf /root/qmail.tar.gz
chmod 755 -R pkg
cd pkg
tar -xzf netqmail-1.05.tar.gz
cd netqmail-1.05
./collate.sh

cd /home/pkg
tar -zxvf daemontools-0.76.tar.gz
cd admin/daemontools-0.76
patch -p1 < /home/pkg/netqmail-1.05/other-patches/daemontools-0.76.errno.patch
package/install  
sleep 5
ps ax | grep svscan 

cd /home/pkg
tar zxvf ucspi-tcp-0.88.tar.gz
cd ucspi-tcp-0.88
patch -p1 < ../ucspi-tcp-0.88.errno.patch  
make
make setup check

mkdir /var/qmail
groupadd nofiles
useradd alias -g nofiles -d /var/qmail/alias -s /sbin/nologin
useradd qmaild -g nofiles -d /var/qmail -s /sbin/nologin
useradd qmaill -g nofiles -d /var/qmail -s /sbin/nologin
useradd qmailp -g nofiles -d /var/qmail -s /sbin/nologin
groupadd qmail
useradd qmailq -g qmail -d /var/qmail -s /sbin/nologin
useradd qmailr -g qmail -d /var/qmail -s /sbin/nologin
useradd qmails -g qmail -d /var/qmail -s /sbin/nologin

userdel postfix
groupadd vchkpw -g 89
useradd vpopmail -u 89 -g vchkpw

cd /home/pkg
tar -xzf toaster-scripts-0.9.0.tar.gz
cd netqmail-1.05/netqmail-1.05/

# 搜索函数straynewline中的451改成553 
vi qmail-smtpd.c

ln -s /usr/kerberos/include/com_err.h /usr/include/
rm -rf /usr/sbin/sendmail

make
make setup check

./config-fast smtp.xxx.jp
cd /var/qmail/alias
echo "admin@xxx.jp">.qmail-postmaster
echo "admin@xxx.jp">.qmail-mailer-daemon
echo "admin@xxx.jp">.qmail-root
chmod 644 /var/qmail/alias/.qmail*

echo ./Maildir/ >/var/qmail/control/defaultdelivery  
echo 3 > /var/qmail/control/spfbehavior

echo MANPATH /var/qmail/man >> /etc/man.config
 
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/pkg/toaster-scripts-0.9.0/send.run /var/qmail/supervise/qmail-send/run
cp /home/pkg/toaster-scripts-0.9.0/send.log.run /var/qmail/supervise/qmail-send/log/run
cp /home/pkg/toaster-scripts-0.9.0/smtpd.run /var/qmail/supervise/qmail-smtpd/run
cp /home/pkg/toaster-scripts-0.9.0/smtpd.log.run /var/qmail/supervise/qmail-smtpd/log/run
cp /home/pkg/toaster-scripts-0.9.0/pop3d.run /var/qmail/supervise/qmail-pop3d/run
cp /home/pkg/toaster-scripts-0.9.0/pop3d.log.run /var/qmail/supervise/qmail-pop3d/log/run
cp /home/pkg/toaster-scripts-0.9.0/pop3ds.run /var/qmail/supervise/qmail-pop3ds/run
cp /home/pkg/toaster-scripts-0.9.0/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

cd /home/pkg
cp toaster-scripts-0.9.0/rc /var/qmail/rc
chmod 755 /var/qmail/rc
cp toaster-scripts-0.9.0/qmailctl /var/qmail/bin/
chmod 755 /var/qmail/bin/qmailctl
ln -s /var/qmail/bin/qmailctl /usr/bin
ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
rm -rf /usr/lib/sendmail
ln -s /var/qmail/bin/sendmail /usr/lib/sendmail 

ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service 
 
netstat -an | grep 25
ps -ef | grep qmail
ps -efl | grep "service errors" | grep -v grep 

cd /home/pkg
tar zxf libdomainkeys-0.68.tar.gz
cd libdomainkeys-0.68
patch -p0 <../libdomainkeys.diff
make

mkdir -p /home/vpopmail/etc 
echo "domiru.com" > /home/vpopmail/etc/defaultdomain
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 

echo "localhost|0|vpopmail|bfjr08|vpopmail" > /home/vpopmail/etc/vpopmail.mysql
chmod 640 /home/vpopmail/etc/vpopmail.mysql 
chown -R vpopmail.vchkpw /home/vpopmail/etc 

mysql -uroot -p0000
CREATE DATABASE vpopmail;
GRANT select,insert,update,delete,create,drop ON vpopmail.* TO vpopmail@localhost IDENTIFIED BY '0000';
FLUSH PRIVILEGES;
QUIT 

cd /home/pkg/
tar zxf vpopmail-5.4.18.tar.gz
cd vpopmail-5.4.18
patch -p0 <../vpopmail-5.4.18-cumulative.patch
 
./configure --enable-incdir=/usr/include/mysql --enable-libdir=/usr/lib64/mysql  --disable-roaming-users --enable-logging=p --disable-passwd --enable-clear-passwd --disable-domain-quotas --enable-auth-module=mysql --enable-auth-logging --enable-sql-logging --disable-valias --disable-mysql-limits --enable-learn-passwords
make
make install-strip

echo 'export PATH=$PATH:/home/vpopmail/bin' >> /etc/profile
source /etc/profile 
vadddomain xxx.jp 22222(passwd)
vadduser -q 105000000 zyf@xxx.jp 11111

cp /home/pkg/toaster-scripts-0.9.0/vpopmailctl /var/qmail/bin
ln -s /var/qmail/bin/vpopmailctl /usr/bin
chmod 755 /var/qmail/bin/vpopmailctl

cd /home/pkg/netqmail-1.05/netqmail-1.05
bunzip2 -c /home/pkg/qmail-toaster-0.9.1.patch.bz2 | patch -p0
make clean
make
qmailctl stop
make setup check
chown -R vpopmail:vchkpw /var/qmail/spam

make cert
make tmprsadh

# now add the followowing line to your crontab via `crontab -e` to update these temp keys each night
01 01 * * * /var/qmail/bin/update_tmprsadh > /dev/null 2>&1

chown -R vpopmail:qmail /var/qmail/control/clientcert.pem /var/qmail/control/servercert.pem

qmailctl start
如果发现log出现如下错误,则要修改/var/qmail/supervise/qmail-smtpd/run
//cat /var/log/qmail/smtpd/current
@4000000049c6fe9e2bcfbc84 /var/qmail/bin/qmail-smtpd: error while loading shared libraries: libdl.so.2: failed to map segment from shared object: Cannot allocate memory
@4000000049c6fe9e2bd507fc tcpserver: end 2152 status 32512
@4000000049c6fe9e2bd50be4 tcpserver: status: 0/20
@4000000049c6fea01a19b1ac tcpserver: status: 1/20
@4000000049c6fea01a19bd64 tcpserver: pid 2153 from 28.30.10.18
@4000000049c6fea01a19c534 tcpserver: ok 2153 0:10.248.238.255:25 :218.30.170.138::3034
@4000000049c6fea01a2ea4f4 /var/qmail/bin/qmail-smtpd: error while loading shared libraries: libdl.so.2: failed to map segment from shared object: Cannot allocate memory
@4000000049c6fea01a334874 tcpserver: end 2153 status 32512//

ln -s /var/qmail/supervise/qmail-pop3d /service
ln -s /var/qmail/supervise/qmail-pop3ds /service 
vpopmailctl start

 
阅读(968) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~