說明:關(guān)于郵件配置這幾篇文章,主要參考的是作者sery博客,里邊還有一些作者的內(nèi)容.本篇配置,大部分軟件版本與原作者的都不相同.同時(shí),里邊更新了一些新的內(nèi)容,如WEBServer 采用nginx,系統(tǒng)版本采用CentOS5.3.這幾篇命名為原創(chuàng)不是作者的本意,為了避免誤解,現(xiàn)更改為轉(zhuǎn)載.但,整篇配置確是作者一步步配置.在原作者的配置上也發(fā)現(xiàn)了一些新的問題.本人會(huì)繼續(xù)開源軟件的研究和實(shí)踐.
系統(tǒng)平臺(tái):CentOS5.3
1. nginx……………………………………………web server
2. Mysql…………………………………………… 用數(shù)據(jù)庫存儲(chǔ)用戶信息
3. Php………………………………………………php(fastcgi)
4. Authlib………………………………………… 與sasl一起做驗(yàn)證
5. Sasl ……………………………………………驗(yàn)證方法
6. Postfix ……………………………………… smtp郵件發(fā)送服務(wù)主程序
7. Courier-imap…………………………………pop3 郵件接收主程序
8. Pcre ……………………………………………安裝Imap需要perl正則表達(dá)式
9. Maildrop…………………………………………郵件投遞代理,郵件轉(zhuǎn)發(fā)到用戶郵箱
10. clamav……………………………………………殺毒軟件
11. amavisd-new………………………………………郵件病毒掃描
12. Mail-SpamAssassin………………………………防垃圾郵件
CentOS5.3系統(tǒng)安裝包,一定要選的6個(gè)包。
1、system tools
2、administration tools
3、development tools
4、development libraries
5、network servers (5.1為network services)
6. base (5.1沒有單獨(dú)列出)
相關(guān)軟件下載地址:
http://prdownloads./courier/courier-authlib-0.62.2.tar.bz2
http://asg3.andrew./pub/cyrus-mail/cyrus-sasl-2.1.22.tar.gz
http://jaist.dl./sourceforge/pcre/pcre-7.8.tar.gz
http://www./source/official/postfix-2.5.6.tar.gz
http://nchc.dl./sourceforge/courier/courier-imap-4.4.1.tar.bz2
http://switch.dl./sourceforge/courier/maildrop-2.0.4.tar.bz2
http:///release/fontconfig-2.6.0.tar.gz
ftp://ftp.openpkg.org/sources/DST/xpm/xpm-3.4k.tar.gz
以下是具體安裝步驟:
一.PHP(FastCGI)環(huán)境
一.PHP(FastCGI)環(huán)境
1.MySQL安裝
@版本:mysql-5.0.41.tar.gz
安裝過程:
……………………………安裝開始………………………………………………
# groupadd mysql
# useradd -g mysql mysql
#./configure --prefix=/usr/local/mysql --with-extra-charsets=gb2312,gbk
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
--sysconfdir=/etc --enable-assembler
# make && make install
# scripts/mysql_install_db --user=mysql //數(shù)據(jù)庫安裝
# bin/mysqld_safe --user=mysql & //起動(dòng)mysqld
…………………………安裝結(jié)束……………………………………………
echo "/usr/local/mysql/lib/mysql">> /etc/ld.so.conf //postfix編譯里會(huì)用到
基本操作:
1. 起動(dòng)/關(guān)閉MySQL
/usr/local/mysql/bin/mysqld_safe &
/usr/local/mysql/bin/mysqladmin -u root –p shutdown
2. 設(shè)置密碼
mysqladmin -u root password 'new-password'
3. 添加 /usr/local/webserver/mysql5/bin 到環(huán)境變量
vi /etc/profile
export PATH=$PATH:/usr/local/mysql/bin
2. GD相關(guān)安裝
1. @版本libpng-1.2.29.tar.gz
###################################################
shell> tar zxvf libpng-1.2.29.tar.gz
shell> cd libpng-1.2.29
shell> ./configure
shell> make
shell> make install
###################################################
2.版本jpegsrc.v6b.tar.gz
#############################################################
shell> tar zxvf jpegsrc.v6b.tar.gz
shell> cd jpeg-6b
Shell> mkdir –p /usr/local/jpeg/bin
Shell> mkdir /usr/local/jpeg/lib
Shell> mkdir /usr/local/jpeg/include
Shell> mkdir /usr/local/jpeg/man
Shell> mkdir /usr/local/jpeg/man1
Shell> mkdir /usr/local/jpeg/man/man1
Shell> ./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
Shell> make && make install
#################################################
3. @版本freetype-2.3.7.tar.gz
#############################################
shell> tar zxvf freetype-2.3.7.tar.gz
shell> cd freetype-2.3.7
shell> ./configure //不指定目錄,方便以下RRDTool安裝
shell> make && make install
##############################################
4.@版本 fontconfig-2.6.0.tar.gz
#################################################
Shell> tar zxvf fontconfig-2.6.0.tar.gz && cd font*
Shell> ./configure --prefix=/usr/local/fontconfig --with-freetype-config=/usr/local/bin/freetype-config
Shell> make && make install
##################################################
5. @版本 gd-2.0.35.tar.gz
GD庫安裝以前先把以上幾個(gè)安裝上,這個(gè)安裝是有一定順序的。
###############################################
Shell> tar zxvf gd-2.0.35.tar.gz
Shell> cd gd-2.0.35
Shell> ./configure --prefix=/usr/local/gd
--with-png
--with-jpeg=/usr/local/jpeg
--with-freetype
--with-fontconfig=/usr/local/fontconfig
Shell> make && make install
###############################################
** Configuration summary for gd 2.0.34:
Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Fontconfig library: yes
Support for Xpm library: no
Support for pthreads: yes
faq:
1> cd . && /bin/sh /usr/local/src/gd-2.0.35/config/missing --run aclocal-1.9 -I config
aclocal:configure.ac:64: warning: macro `AM_ICONV' not found in library
cd . && /bin/sh /usr/local/src/gd-2.0.35/config/missing --run automake-1.9 --foreign
cd . && /bin/sh /usr/local/src/gd-2.0.35/config/missing --run autoconf
configure.ac:64: error: possibly undefined macro: AM_ICONV
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
make: *** [configure] Error 1
解決:
重新make 一下,如果不行,可以安裝下邊的包
安裝gettext包
安裝方式: shell> yum install gettext 或通過手動(dòng)下載gettext包
3.PHP(FastCGI)模式安裝
@php版本:5.2.6
#gzip -cd php-5.2.9-fpm-0.5.10.diff.gz | patch -d php- 5.2.9 -p1
步驟:
###########################################################
#./configure --prefix=/usr/local/phpcgi --with-config-file-path=/usr/local/phpcgi/etc --with-mysql=/usr/local/mysql --with-gd=/usr/local/gd --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/lib --with-freetype-dir=/usr/local/lib --enable-mbstring --enable-mbregex --enable-bcmath --enable-sockets --with-xsl --with-curl --with-curlwrappers --enable-fastcgi --enable-force-cgi-redirect --enable-discard-path --with-openssl --enable-fpm
# make && make install
#cp php.ini-recommended /usr/local/phpcgi/etc/php.ini
######################################################
# /usr/local/phpcgi/etc/php-fpm.conf
<?xml version="1.0" ?>
<configuration>
<section name="global_options">
<value name="pid_file">/usr/local/phpcgi/logs/php-fpm.pid</value>
<value name="error_log">/usr/local/phpcgi/logs/php-fpm.log</value>
<value name="log_level">notice</value>
<value name="emergency_restart_threshold">10</value>
<value name="emergency_restart_interval">1m</value>
<value name="process_control_timeout">5s</value>
<value name="daemonize">yes</value>