rhel 53 64位系统上安装postfix.docx
- 文档编号:7260411
- 上传时间:2023-01-22
- 格式:DOCX
- 页数:18
- 大小:23.61KB
rhel 53 64位系统上安装postfix.docx
《rhel 53 64位系统上安装postfix.docx》由会员分享,可在线阅读,更多相关《rhel 53 64位系统上安装postfix.docx(18页珍藏版)》请在冰豆网上搜索。
rhel5364位系统上安装postfix
rhel5.364位系统上安装postfix
一、简介:
部分软件简介:
1、AMP---apache(web服务)、mysql(数据库)、php(非必需)的简称
2、postfix--mta邮件系统核心
3、courier-authlib--一个为courier-imap,maildrop,sasl2提供用户信息的后台进程序
4、courier-imap--提供pop3,pop3s,imap,imaps服务的程序
5、amavisd-new--提供内容过滤
6、clamav--著名的杀毒软件
7、extmail--一个著名的webmail程序
8、extman--与extmail集成的后台管理程序
9、slockd--一个基于smtp阶段的反垃圾邮件程序
10、vhmgr--由本文作者编写,用于管理apache,ftp,mysql的虚拟主机管理程序。
安装环境:
centos5.2
域名机器名:
域名:
二、安装系统
安装系统时,选择“customizesoftwareselection”(自定义安装),在packagegroupselection对话框里选择:
[*]base
[*]devlopmentlibraries
[*]developmenttools
[*]editors
[*]text-baseinternet
其它不选择。
在setupagnet(或进入系统后运行setup)里选择firewallconfiguration将securitylevel与SELinux改为disabled,目的是为了避免在安装调试时产生不必要的麻烦,在系统安装完成后,可以自己去调试安全部分,在这里将不作详细介绍。
配置yum,在本文中使用的是网通线路,所以选择了作为安装镜像。
[root@localhost~]#cd/etc/yum.repos.d/
[root@localhostyum.repos.d]#wget
[root@localhostyum.repos.d]#mvCentOS-Base.repoCentOS-Base.repo.bak
[root@localhostyum.repos.d]#mvCentOS-Base.repo.ta139CentOS-Base.repo
三、安装软件
1、安装AMP
[root@localhost~]#yum-yinstallhttpdhttpd-develmysqlmysql-develmysql-serverphpphp-xmlphp-cliphp-pdophp-mbstringphp-mcryptphp-gdphp-commonphp-develphp-mysql
修改启动配置并启动
[root@localhost~]#chkconfig--level345 mysqldon
[root@localhost~]#chkconfig--level345 httpdon
[root@localhost~]#servicemysqldstart
[root@localhost~]#servicehttpdstart
2、安装phpmyadmin
注意:
可以选择自己需要的版本
[root@localhost~]#wget
[root@localhost~]#tarxjfphpMyAdmin-2.11.9-all-languages-utf-8-only.tar.bz2
[root@localhost~]#mvphpMyAdmin-2.11.9-all-languages-utf-8-only/var/www/html/phpmyadmin
[root@localhostphpmyadmin]#cpconfig.sample.inc.phpconfig.inc.php
编辑config.inc.php改为下面,字符串是任意的。
$cfg['blowfish_secret']='skssiwksksie';/*YOUMUSTFILLINTHISFORCOOKIEAUTH!
*/
进入phpmyadmin请马上修改mysqlroot用户的密码。
3、导入extman后台数据库
将extmail/extman/slockd上传到服务器,可以使用ftp/winscp上传
[root@localhost~]#tarzxfextman-0.2.5b1.tar.gz
[root@localhost~]#cdextman-0.2.5b1/docs/
[root@localhostdocs]#mysql-uroot-p Enterpassword: [root@localhostdocs]#mysql-uroot-p Enterpassword: 如何使用了phpmyadmin改了root密码,记得输入密码,如果密码为空,请按回车。 4、RPM简介 下面我们将采用rpm的方式安装软件 /usr/src/redhat/SPECspec文件夹,通常是rpm文件夹 /usr/src/redhat/RPMS是生成rpm的文件,下面还有i368,i486等子文件夹,一般我们用i386架构 /usr/src/redhat/SOURCE源文件文件夹 为了安装时切换目录的方便,我们将目录存放到一个shell变量里。 [root@localhost~]#exportRPMS=/usr/src/redhat/RPMS [root@localhost~]#exportSOURCE=/usr/src/redhat/SOURCES [root@localhost~]#exportSPEC=/usr/src/redhat/SPECS 在下面安装过程中,大家要记住cd$RPMS与cd/usr/src/redhat/RPMS的目的是一样的,只是shell变量的替换。 5、安装authlib A、安装依懒的包 [root@localhost~]#yum-yinstallpostgresql-develexpectlibtool-ltdl-devel [root@localhost~]#wget [root@localhost~]#tarxjfcourier-authlib-0.61.0.tar.bz2 [root@localhost~]#cdcourier-authlib-0.61.0 [root@localhostcourier-authlib-0.61.0]#cpcourier-authlib.spec$SPEC [root@localhostcourier-authlib-0.61.0]#cd.. [root@localhost~]#cpcourier-authlib-0.61.0.tar.bz2$SOURCE [root@localhost~]#cd$SPEC [root@localhostSPECS]#rpmbuild-bbcourier-authlib.spec(创建rpm文件) B、安装生成的rpm [root@localhostSPECS]#cd$RPMS/i386 [root@localhosti386]#rpm-ivhcourier-authlib-0.61.0-1.i386.rpm [root@localhosti386]#rpm-ivhcourier-authlib-devel-0.61.0-1.i386.rpm [root@localhosti386]#rpm-ivhcourier-authlib-mysql-0.61.0-1.i386.rpm C、配置authlibdaemon [root@localhosti386]#cd/etc/authlib/ [root@localhostauthlib]#mvauthdaemonrcauthdaemonrc.bak [root@localhostauthlib]#vimauthdaemonrc 输入下面的内容: authmodulelist="authmysql" authmodulelistorig="authmysql" daemons=10 authdaemonvar=/var/spool/authdaemon DEBUG_LOGIN=2 DEFAULTOPTIONS="wbnodsn=1" LOGGEROPTS="" D、配置authmysqlrc [root@localhostauthlib]#mvauthmysqlrcauthmysqlrc.bak [root@localhostauthlib]#vimauthmysqlrc 输入下面的内容: MYSQL_SERVER localhost MYSQL_USERNAME extmail MYSQL_PASSWORD extmail MYSQL_PORT 0 MYSQL_SOCKET /tmp/mysql.sock MYSQL_OPT 0 MYSQL_DATABASE extmail MYSQL_SELECT_CLAUSE SELECTusername,password,"",uidnumber,gidnumber,\ CONCAT('/home/data/domains/',homedir), \ CONCAT('/home/data/domains/',maildir), \ quota, \ name \ FROMmailbox \ WHEREusername='$(local_part)@$(domain)' E、启动authlib [root@localhost~]#servicecourier-authlibstart StartingCourierauthenticationservices: authdaemond [root@localhost~]#chmod777/var/spool/authdaemon/ 6、安装courier-imap 由于courier-imap不能用root身份生成rpm那么我们新建一个普通用户,并创建一个rpm环境 [root@localhost~]#useraddyiyou 软件包依懒需要安装openldap-server,rpm创建完成后可以删除 [root@localhost~]#yum-yinstallopenldap-servers [root@localhost~]#su-yiyou [yiyou@localhost~]$mkdir-prpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS} [yiyou@localhost~]$vim ~/.rpmmacros 输入内容: %_topdir/home/yiyou/rpm [yiyou@localhost~]$wget [yiyou@localhost~]$cpcourier-imap-4.4.1.tar.bz2rpm/SOURCES/ [yiyou@localhost~]$tarxjfcourier-imap-4.4.1.tar.bz2 [yiyou@localhost~]$cdcourier-imap-4.4.1 [yiyou@localhostcourier-imap-4.4.1]$cpcourier-imap.spec../rpm/SPECS/ [yiyou@localhostcourier-imap-4.4.1]$cd../rpm/SPECS/ 编辑courier-imap.spec将下面的内容: %if%suse_version BuildPreReq: rpm>=3.0.5/usr/bin/sedopenldap2openldap2-devel%([%{suse_version}-gt819]&&echo/usr/include/fam.h) %else BuildPreReq: rpm>=4.0.2sed/usr/include/fam.hopenldap-developenldap-servers %endif 改为: %if%suse_version BuildPreReq: rpm>=3.0.5/usr/bin/sedopenldap2openldap2-devel %else BuildPreReq: rpm>=4.0.2sedopenldap-developenldap-servers %endif 创建rpm [yiyou@localhostSPECS]$rpmbuild-bbcourier-imap.spec 完成rpm后,输入exit退出当前用户。 [root@localhost~]#rpm-ivh/home/yiyou/rpm/RPMS/i386/courier-imap-4.4.1-1.i386.rpm [root@localhost~]#servicecourier-imapstart 7、安装cyrus-sasl A、安装SRPM [root@localhost~]#wgetftp: //ftp.uni-bayreuth.de/pub/ [root@localhost~]#rpm-ivhcyrus-sasl-2.1.22-8.fc8.src.rpm [root@localhost~]#cd$SPEC 编辑cyrus-sasl.spec将下面: #BundlingcopyofBerkeleyDB,forsasldbsupport. topdir=`pwd` pushddb-%{db_version}/build_unix ../dist/configure\ --with-mutex=UNIX/fcntl--disable-shared--enable-static--with-pic\ --with-uniquename=_cyrus_sasl_sasldb_rh\ --prefix=${topdir}/db-instroot\ --includedir=${topdir}/db-instroot/include\ --libdir=${topdir}/db-instroot/lib 改为: #BundlingcopyofBerkeleyDB,forsasldbsupport. topdir=`pwd` pushddb-%{db_version}/build_unix ../dist/configure\ --with-mutex=UNIX/fcntl--disable-shared--enable-static--with-pic\ --with-uniquename=_cyrus_sasl_sasldb_rh\ --prefix=${topdir}/db-instroot\ --includedir=${topdir}/db-instroot/include\ --libdir=${topdir}/db-instroot/lib\ --with-authdaemond=/var/spool/authdaemon B、生成rpm [root@localhostSPECS]#rpmbuild-bbcyrus-sasl.spec [root@localhostRPMS]#cd$RPMS/i386 [root@localhosti386]#rpm-e--nodepscyrus-sasl-develcyrus-sasl-plaincyrus-saslcyrus-sasl-lib(如果这些包存在) [root@localhosti386]#rpm-ihvcyrus-sasl-lib-2.1.22-8.i386.rpm [root@localhosti386]#rpm-ihvcyrus-sasl-2.1.22-8.i386.rpm [root@localhosti386]#rpm-ihvcyrus-sasl-plain-2.1.22-8.i386.rpm C、配置sasl2 创建/usr/lib/sasl2/smtpd.conf文件,输入下面的内容: pwcheck_method: authdaemond log_level: 3 mech_list: PLAINLOGIN authdaemond_path: /var/spool/authdaemon/socket 8、安装postfix A、下载软件包 [root@localhosti386]#cd [root@localhost~]#wgethttp: //ftp.wl0.org/official/2.5/SRPMS/postfix-2.5.4-2.src.rpm [root@localhost~]#rpm-ivhpostfix-2.5.4-2.src.rpm [root@localhost~]#cd$SPEC 编辑postfix.spec修改下面的选项 %definedistributionrhel-5.0 %definewith_mysql_redhat1 %definewith_sasl 2 %definewith_vda 1 B、创建rpm [root@localhostSPECS]#rpmbuild-bbpostfix.spec [root@localhostRPMS]#cd$RPMS/i386 [root@localhosti386]#rpm-ivhpostfix-2.5.4-2.rhel4.i386.rpm C、切换mta [root@localhosti386]#alternatives--configmta(选择2,postfix) [root@localhosti386]#rpm-esendmail [root@localhosti386]#cd/usr/sbin/ [root@localhostsbin]#mvsendmailsendmail.bak [root@localhostsbin]#newaliases [root@localhostsbin]#ln-ssendmail.postfixsendmail D、配置postfix [root@localhost~]#cd/etc/postfix/ [root@localhostpostfix]#mvmain.cfmain.cf.bak [root@localhostpostfix]#vimmain.cf 输入下面的内容: queue_directory=/var/spool/postfix command_directory=/usr/sbin daemon_directory=/usr/libexec/postfix data_directory=/var/lib/postfix mail_owner=postfix unknown_local_recipient_reject_code=550 debug_peer_level=2 debugger_command= PATH=/bin: /usr/bin: /usr/local/bin: /usr/X11R6/bin ddd$daemon_directory/$process_name$process_id&sleep5 sendmail_path=/usr/sbin/sendmail.postfix newaliases_path=/usr/bin/newaliases.postfix mailq_path=/usr/bin/mailq.postfix setgid_group=postdrop
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- rhel 53 64位系统上安装postfix 64 系统 安装 postfix