系统CentOS5.0 linux text方式最小化安装
1.删除cyrus-sasl和sendmail以免出现冲突
yum remove sendmail cyrus-sasl-plain cyrus-sasl -y
yum update -y
yum install gcc gcc-c++ libtermcap-devel zlib-devel libxml2-devel libpng-devel db4-devel libXpm gd tcl-devel libart_lgpl libart_lgpl-devel pcre-devel gdbm-devel perl-libwww-perl perl-URI perl-Digest-HMAC -y
libtermcap-devel MySQL需要, zlib-devel OPENSSL需要,db4-devel POSTFIX需要,libxml2-devel libpng-devel PHP需要,libXpm gd PERL-GD需要,tcl-devel libart_lgpl libart_lgpl-devel MAILGRAPH和QMONITOR需要,pcre-devel gdbm-devel MAILDROP需要
2.数据库安装
groupadd mysql
useradd -g mysql -s /bin/false -M mysql
tar xzvf mysql-5.1.22-rc.tar.gz
cd mysql-5.1.22-rc
./configure --prefix=/usr/local/mysql --enable-thread-safe-client --enable-local-infile --with-charset=utf8 --enable-assembler --with-extra-charsets=gbk,gb2312 --with-low-memory --with-unix-socket-path=/tmp/mysql.sock --with-mysqld-ldflags=-all-static --localstatedir=/usr/local/mysql/var
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
bin/mysqld_safe --user=mysql &
cd /usr/local/src/mysql-5.1.22-rc/
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod 700 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 3 mysqld on
/usr/local/mysql/bin/mysqladmin ping
/usr/local/mysql/bin/mysqladmin version
echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
ldconfig -v
ln -s /usr/local/mysql/bin/* /usr/bin/
3.数据库安装
tar xzvf openssl-0.9.8e.tar.gz
cd openssl-0.9.8e
./config shared zlib
make
make test
make install
mv /usr/bin/openssl /usr/bin/openssl.OFF
rm -rf /usr/lib/libssl3.so
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
ln -s /usr/local/ssl/lib/libssl.so.0.9.8 /usr/lib/libssl.so
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
ldconfig -v
openssl version
4. cyrus-sasl安装
tar xzvf cyrus-sasl-2.1.22.tar.gz
cd cyrus-sasl-2.1.22
./configure --prefix=/usr/local/sasl2 --disable-gssapi --disable-anon --disable-sample --disable-digest --enable-plain --enable-login --with-authdaemond=/usr/local/courier-authlib/var/spool/authdaemon/socket
cp mac/libdes/public/des.h .
make
make install
mv /usr/lib/libsasl2.so.2 /usr/lib/libsasl2.so.2.OFF
mv /usr/lib/libsasl2.so.2.0.22 /usr/lib/libsasl2.so.2.0.22.OFF
mv /usr/lib/sasl2/ /usr/lib/sasl2.OFF
ln -s /usr/local/sasl2/lib/* /usr/lib
ln -s /usr/local/sasl2/lib/* /usr/local/lib
ln -s /usr/local/sasl2/include/sasl/* /usr/local/include
mkdir -p /var/state/saslauthd
/usr/local/sasl2/sbin/saslauthd -a shadow pam -d
/usr/local/sasl2/sbin/saslauthd -a shadow pam
/usr/local/sasl2/sbin/testsaslauthd -u root -p root密码
echo "/usr/local/sasl2/lib" >> /etc/ld.so.conf
echo "/usr/local/sasl2/lib/sasl2" >> /etc/ld.so.conf
ldconfig -v
echo "/usr/local/sasl2/sbin/saslauthd -a shadow pam">>/etc/rc.local
5.apache安装
tar xzvf httpd-2.2.6.tar.gz
cd httpd-2.2.6
./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-ssl --with-ssl=/usr/local/ssl --enable-track-vars --enable-rewrite --with-zlib --enable-mods-shared=most --enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/var/www --with-mpm=worker
make
make install
ln -s /usr/local/apache/bin/* /usr/bin/
echo "/usr/local/apache/bin/apachectl start" >> /etc/rc.local
6.PHP安装(可选)
tar xzvf php-5.2.4.tar.gz
cd php-5.2.4
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-xml --with-png --with-jpeg --with-zlib --with-freetype --with-gd --enable-track-vars --enable-mbstring=all
make
make test
make install
cp php.ini-dist /usr/local/php/lib/php.ini
7.postfix邮件mta安装
groupadd -g 2525 postfix
useradd -g postfix -u 2525 -s /sbin/nologin -M postfix
groupadd -g 2526 postdrop
useradd -g postdrop -u 2526 -s /bin/false -M postdrop
tar xzvf postfix-2.5-20071006.tar.gz
cd postfix-2.5-20071006
make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/local/sasl2/include/sasl -DUSE_TLS -I/usr/local/ssl/include/openssl ' 'AUXLIBS=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm -L/usr/local/sasl2/lib -lsasl2 -L/usr/local/ssl/lib -lssl -lcrypto'
make
make install
(tempdir: [/usr/local/src/postfix-2.5-20071006] /tmp
html_directory: [no] /var/www/postfix_html其他默认)
mv /etc/aliases /etc/aliases.OFF
ln -s /etc/postfix/aliases /etc/aliases
newaliases
postconf -n > /etc/postfix/main.cf.tmp
mv /etc/postfix/main.cf /etc/postfix/main.cf.backup
mv /etc/postfix/main.cf.tmp /etc/postfix/main.cf
vi /etc/postfix/main.cf
添加以下
##########################User Specified############################
myhostname = mail.eyaotong.com
myorigin = eyaotong.com
mydomain = eyaotong.com
mydestination =
mynetworks = 127.0.0.0/8
inet_interfaces = all
############################CYRUS-SASL############################
broken_sasl_auth_clients = yes