邮件系统升级为 postfix+ sasl2+ courier-imap+ mailscanner+ webmail

前两天完成了系统从FreeBSD4.10Stable升级到6.1Release,在内核里面增加了对ipfw和xeon处理器的超线程支持,并在这基础上把以前基于sendmail和sasl的邮件系统升级到了postfix,增加了对垃圾邮件、病毒检测的支持,还配置了一套免费的webmail系统,可以通过http://mail.toplee.com访问。

这次升级过程可以说费时费力,中间经历了若干次各种问题,最终的结果还是比较满意的,在这里把此次升级的笔记整理一下。由于整个升级的过程非常复杂,这里就把最关键的几个部分整理出来。

1、升级内核源文件后编译自己定制的内核
在使用cvsup -g -L 2 xxxx升级完源码树和ports树后执行下面的命令
#cd /sys/i386/conf/
#cp ./GENERIC ./TOPLEE (这个名字自己随便改)
#vi ./TOPLEE
下面是我在文件中增加和修改的部分,其他内核定制部分使用了默认的数据

#Michael
cpu I686_CPU #指定我的机器cpu类型
ident TOPLEE-SMP
options SMP #对xoen至强CPU超线程的支持
options SC_DISABLE_REBOOT #屏蔽ctrl+alt+del重启机器的功能
options QUOTA #支持磁盘配额

options IPFIREWALL #支持防火墙
options DUMMYNET
options HZ=3000
options IPDIVERT
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=100
options IPSTEALTH
options TCP_DROP_SYNFIN
options IPFIREWALL_DEFAULT_TO_ACCEPT
#options ICMP_BANDLIM
options ACCEPT_FILTER_DATA
options ACCEPT_FILTER_HTTP
#options IPFILTER
#options IPFILTER_LOG
#options IPFILTER_DEFAULT_BLOCK
#END Michael

#/usr/sbin/config TOPLEE
#cd /sys/comile/TOPLEE
#make depend
#make
#make install
在这里,也可使用另外的方法编译新的内核,在修改好TOPLEE文件后
# cd /usr/src
# make buildkernel KERNCONF=TOPLEE
# make installkernel KERNCONF=TOPLEE

到此完成升级,输入reboot重启服务器,在启动过程中可以看到类似下面的提示信息
FreeBSD 6.1-RELEASE #0: Wed May 24 13:32:37 CST 2006
root@www.toplee.com:/usr/src/sys/i386/compile/TOPLEE
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Xeon(TM) CPU 3.00GHz (2991.18-MHz 686-class CPU)
Origin = "GenuineIntel" Id = 0xf29 Stepping = 9
Features=0xbfebfbff
Features2=0x4400>
Logical CPUs per core: 2
real memory = 1073676288 (1023 MB)
avail memory = 1041567744 (993 MB)
ACPI APIC Table: < A M I OEMAPIC >
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
cpu0 (BSP): APIC ID: 0
cpu1 (AP): APIC ID: 1
可以看到系统使用了刚新定制的内核TOPLEE启动,并且支持了至强CPU的超线程。

接下来需要安装下列软件(具体的根据您的需要选择)
Apache
MySQL
php
php-extension
phpmyadmin
proftpd
mrtg
awstats
logrotate
djbdns
net-snmp
openssl

这些软件全部使用FreeBSD的prts进行自动安装,过程都很简单,不多说,有关proftpd、mrtg、awstats、djbdns以及snmp的安装配置可以参照我另外的BLOG。下面重点记录一下postfix相关的部分。

2、postfix 相关安装和关键配置文件记录(待续。。。)

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
2 Responses
  1. 随风 says:

    呵呵,期待Michael大哥做一个postfixr的完全安装文档

  2. Michael says:

    [Comment ID #1395 Will Be Quoted Here]

    嗯,要不是兄弟提醒,差点忘了这个文档还没有写完,这两天抽空给整理出来:)大家相互学习和交流,共同进步。

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image