返回列表 回复 发帖

【原创】Freebsd postfix with SASL2 mysql courier-imap完全ports安装

[B]Freebsd postfix with SASL2 mysql courier-imap完全ports安装[/B]
作者:柯贵中 QQ:93606088 E-mail:chaohu@tom.com

      版权所有:华柯天下(www.chinake.com)。如有转载,请注明来源,本文形成于2005年4月30日。
     本文硬件环境为:CII800+256M+intel815E+40G+intel 10/100 pro+ADSL上网。
软件环境为:Windows xp sp2+Vmware 5.0+secureCRT4.1+leapftp+freebsd 4.10
2005年5月6日,本系统在freebsd 5.3下测试通过。
本系统最大的优点是简单,而且支持加密认证和安全连接。认证部分使用courier认证,是同一个进程,效率更高。配置文件更少。


――――――――――――――――――――――――――――――――――――――――
1、基本系统准备
1.1准备网络环境,使虚拟机也能上网
首先安装下载4.10-RELEASE-i386-disc1.iso,然后安装Vmware5.0,安装好后会产生两个网络连结,我们禁用它(用不上),在ADSL连结上右击――属性――共享――共享到本地连结――确定。在本地连结上右击――internet 协议(tcp/ip)――使用下面的DNS服务器地址,将ADSL拨号所获取的DNS地址(如:202.102.192.68)填入――确定。
1.2创建freebsd虚拟机
启动Vmware――new virtual machine――下一步――typical――下一步――other――freebsd――下一步――(修改保存虚拟机的路径,要求空间不得少于4G)下一步(use bridged networking)――下一步disk size(分配最大空间)为10G――完成。
单击edit virtual machine setting 调节虚拟机内存为128M,调整CD-ROM――USE ISO image,浏览到我们下载的4.10-RELEASE-i386-disc1.iso后OK。注意虚拟机和windows xp间的切换键为 Ctrl+Alt。
1.3安装freebsd系统
启动虚拟机进入freebsd安装界面。
1.3.1 Skip kernel configuration and continue with installation
1.3.2 standard,进入硬盘管理,直接按a、q。
1.3.3 引导程序选standard,进入分区管理,直接按a、q。
1.3.4 选择安装包,我选择Minimal,也可以选择All,使用上下键+空格选择,左右键在OK和cancel之间选择,然后回车,大约5分钟。
注意:没有说明的直接回车确定。如果是实际机器安装,请自行确定好网络环境。
由于ports安装下载程序为单线程,太慢,所以准备在win下将所需要的软件用google找到下载回来,通过ftp上传到freebsd,并且使用sshd管理freebsd,所以需要增加一个wheel组用户帐号。
1.3.5 User confirmation requested
Would you like to configure any Ethernet or slip/ppp network devices?(yes)
选择lnc lance/pcnet (isolan/novell ne2100/ne32-vl)Ethernet,
do you want to try ipv6 configuration of the interface ?(no)
do you want to try dhcp configuration of the interface?(no)
1.3.6主机和网络配置,能不能上网关键在这里
host: mail
domain:chinake.com
ipv4 gateway:192.168.0.1
name server:202.102.192.68
ipv4 address:192.168.0.66
netmask:255.255.255.0.
would you like to bring the lnc0 interface up right now?(yes)
do you want this machine to function as a network gateway?(no)
1.3.7开启ftp服务,便于以后上传文件,如果你的网络快,也可不开启。
do you want to configure inetd and the network services that it provides?(yes)
将ftp前的#号给删了,然后敲Esc一次,回车两次。
Do you want to have anonymous ftp access to this machine?(no)
Do you want to configure this machine as an NFS server?(no)
Do you want to configure this machine as an NFS client?(no)
Do you want to select a default security profile for this host?(no)
Would you like to customize your system console setting?(no)
Would you like to set this machine’s time zone now?(no)
Would you like to enable Linux binary compatibility?(yes)
Does this system have a non-usb mouse attaché to it?(yes)
选择2 enable test and run the mouse daemon,然后exit
1.3.8 增加软件包,这里只需要增加更新ports树程序
the freebsd package collection is a collection of thousands of ready-to-run applications, from text editors to games to web servers and more. would you browse the collection now?(yes). 如果想以后配置,可以运行/stand/sysinstall.
选择All――用空格键选择cvsup-16.1h和portupgrade-20040325_1,ok――install.
1.3.9增加系统用户,并使它具有wheel组权限。
Would you like to add any initial user accounts to the system?(yes)
User add a new user to the system
Login id:chaohu
Uid:1001
Group: wheel
Password:chaohu
Ok――exit
1.3.10 修改root用户密码
Now you must set the system manager’s password
This is the password you’ll use to log in as “root”.
输入两次密码,注意输入时是看不见的。
选择no――exit install――yes,重启电脑。FREEBSD 基本系统安装成功。



――――――――――――――――――――――――――――――――――――――――
2、WEB服务器系统软件安装
2.1建立sshd连接
安装secureCRT,启动后新建连结。
Name :mail.chinake.com
Hostname:192.168.0.66
Username:chaohu
Password:chaohu
$su
password:
mail#
注:#表示是root身份,$表示普通用户身份。
以下如无特别说明,所有命令都是以root用户身份运行。
2.2 更新ports树。
cd /usr/share/examples/cvsup; cvsup -g -L 2 -h ftp.freebsdchina.org ports-supfile
大约十几分钟,取决于网络的快慢。
mkdir /usr/ports/distfiles
chmod 777 /usr/ports/distfiles
更改这个目录为所有用户可写,使用leapftp软件,ftp://192.168.0.66,用户名和密码:chaohu,登入,并切换到该目录,上传所需要软件,主要是比较大的软件包,如mysql等。
2.3 安装openssl
cd /usr/ports/security/openssl; make install clean
2.4 安装mysql数据库,建议安装3.23或4.0版。
cd /usr/ports/databases/mysql323-server/;
make BUILD_OPTIMIZED=yes WITH_OPENSSL=yes install clean
ee /etc/rc.conf;加入:mysql_enable="YES"
2.5 安装apache
cd /usr/ports/www/apache13-modssl;make install clean
支持https连接,web服务路径为:/usr/local/www/data/。也可以选择apache2。
ee /etc/rc.conf;加入:apache_enable="YES"
2.6 安装php4
cd /usr/ports/lang/php4;make install clean
cp /usr/local/etc/php.ini.dist /usr/local/etc/php.ini
ee /usr/local/etc/apache/httpd.conf
在最后加入:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

2.7 安装phpmyadmin
由于phpmyadmin默认安装路径为:/usr/local/www/phpMyAdmin
而我们的web服务路径是:/usr/local/www/data/
所以我们要更改其默认的安装。
cd /usr/ports/databases/phpmyadmin;
ee Makefile
将www/全部更改为www/data/。
make install clean
ee /usr/local/www/data/phpMyAdmin/config.inc.php;
将第一个config,改为http
$cfg['PmaAbsoluteUri'] = 'http://192.168.0.66/phpMyAdmin/';
$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
2.8 安装perl5.8
cd /usr/ports/lang/perl5.8/;make install clean
完成后根据提示执行:
/usr/local/bin/use.perl port
2.9 安装expect
cd /usr/ports/lang/expect
make install clean
2.10 安装postfixadmin
同phpmyadmin一样,其默认安装目录为:/usr/local/www/postfixadmin/,
所以我也想把它安装到/usr/local/www/data/postfixadmin/下,修改makefile,将所有www/,都改为www/data/,注意有很多处。
cd /usr/ports/mail/postfixadmin;ee Makefile;make install clean
导入数据库:
cd /usr/local/www/data/postfixadmin/
mysql
返回列表
开源邮件服务器 开源邮件服务器 web 开源邮件 开源 mail 开源 邮件服务器 邮件技术 mail技术 反垃圾邮件 反垃圾mail mail投递
邮件服务器 mail服务器 开源软件 mail软件 mail服务新品牌 开源邮件服务新品牌
开源mail服务新网站 邮件服务新品牌 mail tmail mailserver 163邮件 sendmail |Linux维护|Linux代维|成都Linux维护|成都Linux代维