我在http://http www.fsjhn.com-free...

用户名:Slaytanic
文章数:132
评论数:758
访问量:1487478
注册日期:
阅读量:1297
阅读量:3317
阅读量:583357
阅读量:468434
51CTO推荐博文
一、准备工作1.一台服务器或可充当服务器的电脑2.FreeBSD的***盘,DVD格式的二、***步骤1.***FreeBSD操作系统2.portsnap更新ports树3.编译需要的软件----------------------------------------进入/usr/ports/www/nginx执行make config选择如下[X] FILE_AIO[X] HTTP_MODULE[X] HTTP_CACHE_MODULE&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&[X] HTTP_GZIP_STATIC_MODULE&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&[X] HTTP_PERL_MODULE[X] HTTP_REALIP_MODULE[X] HTTP_REWRITE_MODULE[X] HTTP_SECURE_LINK_MODULE[X] HTTP_SSL_MODULE[X] HTTP_SUB_MODULE[X] HTTP_XSLT_MODULE[X] WWW然后make install clean--------------------------------进入/usr/port/lang/php52执行make config[X] CLI[X] CGI[X] REDIRECT[X] DISCARD[X] FASTCGI[X] FPM[X] PATHINFO执行make install clean--------------------------------进入/usr/ports/lang/php52-extensions执行make config[X] BZ2[X] CALENDAR[X] CTYPE[X] CURL[X] DOM[X] FILEINFO[X] FILTER[X] GD[X] GETTEXT[X] HASH[X] ICONV[X] IMAP[X] JSON[X] MBSTRING[X] MCRYPT[X] MHASH[X] MYSQL[X] MYSQLI[X] OPENSSL[X] PCNTL[X] PCRE[X] PDO[X] PDO_MYSQL[X] POSIX[X] SESSION[X] SIMPLEXML[X] SNMP[X] SOCKETS[X] SPL[X] SYSVMSG[X] SYSVSEM[X] SYSVSHM[X] TOKENIZER[X] XML[X] XMLREADER[X] XMLRPC[X] XMLWRITER[X] XSL[X] ZIP[X] ZLIB执行make install clean--------------------------进入/usr/ports/databases/mysql55-server执行make config[X] OPENSSL执行make install clean--------------------------进入/usr/port/mail/courier-imap执行make config[X] AUTH_MYSQLmake install clean---------------------------进入/usr/ports/mail/postfix执行make config[X] PCRE[X] SASL2[X] TLS[X] MYSQL[X] VDAmake install clean----------------------------进入/usr/ports/security/clamav执行make config[X] ARC[X] ARJ[X] LHA[X] UNZOO[X] UNRAR[X] LLVM[X] TESTS[X] MILTER[X] ICONV&&&&&&&&&&&&&&&& Enable ICONV supportmake install clean-----------------------------进入/usr/ports/security/amavisd-new执行make config[X] MYSQL[X] SASL[X] SPAMASSASSIN[X] FILE[X] RAR[X] UNRAR[X] ARJ[X] LHA[X] ARC[X] CAB[X] RPM[X] ZOO[X] LZOP[X] FREEZE[X] P7ZIP[X] MSWORDmake install clean---------------------------------进入/usr/ports/mail/p5-Mail-SpamAssassin执行make config[X] AS_ROOT[X] SPAMC[X] DKIM[X] SSL[X] GNUPG[X] MYSQL执行make install clean-----------------------------进入/usr/ports/mail/postfixadmin执行make config[X] MYSQL[X] MYSQLI执行make install clean软件***工作完成,进入配置阶段,我很喜欢FreeBSD的一点就是,软件编译完成之后,所有的配置文件都会放在/usr/local/etc下,不需要你到处去找conf或者etc文件夹。4.配置文件重要第一步打开/etc/rc.conf写入nginx_enable="YES"mysql_enable="YES"php_fpm_enable="YES"进入/usr/local/etc/rc.d依次执行#./nginx start#./mysql-server start#./php-fpm start配置你的nginx和php,打开你的网站,直到你看见http://localhost/postfixadmin的***界面,***他。进入/usr/local/etc/postfix打开main.cf,到文件尾加入下列代码#======= BASE ==============#myhostname = mail#mydomain = home_mailbox = maildir/#mydestination = $myhostname#local_recipient_maps =command_directory = /usr/local/sbinlocal_transport = virtual#======= MYSQL =============virtual_gid_maps = static:80virtual_mailbox_base = /data/mail/virtualvirtual_uid_maps = static:80virtual_minimum_uid = 80virtual_alias_maps = mysql:/usr/local/etc/postfix/virtual_alias_maps.cfvirtual_mailbox_domains = mysql:/usr/local/etc/postfix/virtual_domains_maps.cfvirtual_mailbox_maps = mysql:/usr/local/etc/postfix/virtual_mailbox_maps.cf#======= Quota ============message_size_limit = 5242880virtual_mailbox_limit_inbox = novirtual_mailbox_limit_override = yesvirtual_maildir_extended = yesvirtual_mailbox_extend = yesvirtual_mailbox_limit_override = yesvirtual_create_maildirsize = yesvirtual_mailbox_limit_maps = mysql:/usr/local/etc/postfix/virtual_mailbox_limit_maps.cfvirtual_mailbox_limit = #======== SASL ================smtpd_sasl_auth_enable = yessmtpd_sasl2_auth_enable = yessmtpd_sasl_security_options = noanonymoussmtpd_sasl2_security_options = noanonymousbroken_sasl_auth_clients = yessmtpd_delay_reject=yessmtpd_recipient_restrictions = permit_sasl_authenticated,permit_auth_destination,rejectsmtpd_client_restrictions = permit_sasl_authenticated#smtpd_sasl_local_domain = $mydomainsmtpd_helo_required = yesstrict_rfc821_envelopes = yes保存退出,注意80是用户和组ID,如果你的nginx用户和组ID不是80,你就需要改这两个数字---------------------新建/usr/local/etc/postfix/virtual_mailbox_limit_maps.cfuser = rootpassword = xxxxxxxhosts = localhostdbname = postfixtable = mailboxselect_field = quotawhere_field = username保存退出----------------------新建/usr/local/etc/postfix/virtual_alias_maps.cfuser = rootpassword = xxxxxxxhosts = localhostdbname = postfixtable = aliasselect_field = gotowhere_field = address保存退出-----------------------新建/usr/local/etc/postfix/virtual_domains_maps.cfuser = rootpassword = xxxxxxxxhosts = localhostdbname = postfixtable = domainselect_field = descriptionwhere_field = domain保存退出------------------------新建/usr/local/etc/postfix/virtual_mailbox_maps.cfuser = rootpassword = xxxxxxxxhosts = localhostdbname = postfixtable = mailboxselect_field = maildirwhere_field = username保存退出-------------------------打开/usr/local/etc/authlib/authdaemonrc,找到authmodulelist=删除其他选项,只留authmysql,找到authmodulelistorig=删除其他,只保留authmysql。加入version="authaemond.mysql"保存退出--------------------------打开/usr/local/etc/authlib/authmysqlrcDEFAULT_DOMAIN your.domianMYSQL_CRYPT_PWFIELD passwordMYSQL_DATABASE postfixMYSQL_GID_FIELD '80'MYSQL_HOME_FIELD '/data/mail/virtual'MYSQL_LOGIN_FIELD usernameMYSQL_MAILDIR_FIELD maildirMYSQL_NAME_FIELD nameMYSQL_OPT 0MYSQL_PASSWORD&&&&xxxxxxxxxxMYSQL_PORT 3306#MYSQL_QUOTA_FIELD quotaMYSQL_SERVER&&&&&&&&127.0.0.1MYSQL_UID_FIELD '80'MYSQL_USERNAME&&&&rootMYSQL_USER_TABLE mailbox保存退出----------------------------进入/usr/local/lib/sasl2/新建文件smtpd.confpwcheck_method: authdaemondlog_level: 3mech_list: PLAIN LOGINauthdaemond_path: /var/run/authdaemond/socket保存退出----------------------------然后进入/etc,编辑rc.conf,加入clamav_clamd_enable="YES"clamav_freshclam_enable="YES"clamav_milter_enable="YES"spamd_enable="YES"sendmail_enable="NONE"sendmail_submit_enable="NO"sendmail_outbound_enbale="NO"#sendmail_msp_queue_enable="NO"postfix_enable="YES"courier_authdaemond_enable="YES"courier_imap_imapd_enable="YES"courier_imap_imapd_ssl_enable="YES"courier_imap_pop3d_enable="YES"courier_imap_pop3d_ssl_enable="YES"amavisd_enable="YES"amavisd_pidfile="/var/amavis/amavisd.pid"amavisd_ram="512m"amavis_milter_enable="YES"amavis_p0fanalyzer_enable="YES"amavis_p0fanalyzer_p0f_filter="tcp dst port 25"重启电脑,如果你不想重启,就在/etc下运行#sh rc#rehash#newaliases如果你还想使用ssl的imap或pop3,就需要用openssl生成比较合法的pem文件5.***webmail进入/usr/ports/mail/atmail执行make config[X] MBSTRING[X] ICONV执行make install clean完成,这里需要说明,atmail***完成后,你需要去/usr/local/www/atmail下面执行#php lang.php all然后你才能使用中文,否则你只有英文可以用。但是默认没有简体中文,只有繁体的。imapd和postfix有任何问题可以去/var/log/maillog里面tail跟踪。本文出自 “” 博客,转载请与作者联系!
了这篇文章
类别:┆阅读(0)┆评论(0)
17:15:10 15:05:42

参考资料

 

随机推荐