################(1)安装ncurses-5.6################
cd /opt
tar zxvf ncurses-5.6.tar.gz
cd ncurses-5.6
./configure --prefix=/usr --with-shared --without-debug
make
make install
cd /opt
groupadd mysql
useradd mysql -g mysql -s /sbin/nologin
tar -zxvf mysql-5.0.51a.tar.gz
cd mysql-5.0.51a
./configure --with-mysqld-user=mysql --prefix=/usr/local/mysql5 --with-charset=gbk --with-extra-charset=all --without-isam --exec-prefix=/usr/local/mysql5
make;make install
cp /usr/local/mysql5/share/mysql/my-medium.cnf /usr/local/mysql5/var/my.cnf
cp /usr/local/mysql5/share/mysql/mysql.server /etc/init.d/mysqld
chmod 700 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 2345 mysqld on
chown mysql:mysql -R /usr/local/mysql5/
service mysqld start
ln -s /usr/local/mysql5/bin/mysql /sbin/mysql
ln -s /usr/local/mysql5/bin/mysqladmin /sbin/mysqladmin
echo "/usr/local/mysql5/lib/mysql" >> /etc/ld.so.conf
ldconfig -v
export PATH=$PATH:/usr/local/mysql5/bin
netstat -nplt | grep mysql
ps aux|grep mysql
###################(3)安装ZLIB2#######################
cd /opt
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
make
make install
cd /opt
tar zxvf openssl-0.9.8g.tar.gz
cd openssl-0.9.8g
./config shared zlib
make
make test
make install
mv /usr/bin/openssl /usr/bin/openssl.OFF
mv /usr/include/openssl /usr/include/openssl.OFF
rm /usr/lib/libssl.so
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
ln -sv /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
cd /opt
tar zxvf 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 --enable-sql --with-mysql=/usr/local/mysql5 -with-mysql-includes=/usr/local/mysql5/include/mysql --with-mysql-libs=/usr/local/mysql5/lib/mysql --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.save
mv /usr/lib/libsasl2.so.2.0.22 /usr/lib/libsasl2.so.2.0.22.save
ln -sv /usr/local/sasl2/lib/* /usr/lib
ln -sv /usr/local/sasl2/lib/* /usr/local/lib
ln -sv /usr/local/sasl2/include/sasl/* /usr/local/include
#创建运行时需要的目录并调试启动
mkdir -pv /var/state/saslauthd
/usr/local/sasl2/sbin/saslauthd -a shadow pam -d
/usr/local/sasl2/sbin/saslauthd -a shadow pam
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
cd /opt
tar zxvf db-4.5.20.tar.gz
cd db-4.5.20/build_unix
../dist/configure --prefix=/usr/local/BerkeleyDB
make;make install
ln -sv /usr/local/BerkeleyDB/include/db.h /usr/include/db.h
ln -sv /usr/local/BerkeleyDB/include/db_cxx.h /usr/include/db_cxx.h
echo "/usr/local/BerkeleyDB/lib" >> /etc/ld.so.conf
cd /opt
tar jxvf httpd-2.2.8.tar.bz2
cd httpd-2.2.8
./configure --prefix=/usr/local/apache2 --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
make;make install
/usr/local/apache2/bin/apachectl start
echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.local
cd /opt
tar zxvf libpng-1.2.26.tar.gz
cd libpng-1.2.26
cp scripts/makefile.linux ./makefile
./configure --prefix=/usr/local/libpng
make;make install
cd /opt
tar zxvf freetype-2.3.5.tar.gz
cd freetype-2.3.5
./configure
make;make install
cd /opt
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
mkdir -pv /usr/local/jpeg/{,bin,lib,include,man/man1,man1}
./configure --prefix=/usr/local/jpeg --enable-shared --enable- static
make;make install
cd /opt
tar zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --with-png --with-freetype --with-jpeg=/usr/local/jpeg/
make;make install
cd /opt
tar zxvf libxml2-2.6.31.tar.gz
cd libxml2-2.6.31
./configure --prefix=/usr/local/libxml2
make;make install
cp xml2-config /usr/bin
cd /opt
tar zxvf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
make;make install
cd /opt
tar zxvf php-5.2.5.tar.gz
cd php-5.2.5
./configure --prefix=/usr/local/php5 --with-mysql=/usr/local/mysql5 --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/include/freetype2 --with-zlib --with-png-dir=usr/local/libpng12 --with-libxml-dir=/usr/local/libxml2 --with-gd --enable-ftp --enable-sockets -enable-mbstring=all- --with-mcrypt --with-mysqli=/usr/local/mysql5/bin/mysql_config
make;make install
cp php.ini-dist /usr/local/php5/lib/php.ini
#要改的有如下几处:
找到LoadModule php5_module modules/libphp5.so
前面的#号去掉(默认已去掉注释)
#AddType application/x-gzip .gz .tgz
下加二行
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .bid
还有找到DirectoryIndex index.html
加上 index.php 让它把index.php做为默认页
/usr/local/apache2/bin/apachectl start
cd /opt
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
cd postfix-2.4.5
make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql5/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/local/sasl2/include/sasl -I/usr/local/BerkeleyDB/include -DUSE_TLS -I/usr/local/ssl/include/openssl ' 'AUXLIBS=-L/usr/local/mysql5/lib/mysql -lmysqlclient -lz -lm -L/usr/local/sasl2/lib -lsasl2 -L/usr/local/BerkeleyDB/lib -L/usr/local/ssl/lib -lssl -lcrypto'
make;make install
tempdir: [/usr/local/src/ postfix-2.4.5] /tmp
config_directory: [/etc/postfix] /etc/postfix
daemon_directory: [/usr/libexec/postfix] /usr/local/postfix/libexec
command_directory: [/usr/sbin] /usr/local/postfix/sbin
queue_directory: [/var/spool/postfix]
sendmail_path: [/usr/sbin/sendmail]
newaliases_path: [/usr/bin/newaliases]
mailq_path: [/usr/bin/mailq]
mail_owner: [postfix]
setgid_group: [postdrop]
html_directory: [no] /usr/local/apache2/htdocs/mail/postfix_html
manpages: [/usr/local/man] /usr/local/postfix/man
readme_directory: [no]
newaliases
ln -s /etc/aliases.db /etc/postfix/aliases.db
#修改以下几项为您需要的配置
myhostname = mail.benet.org
myorigin = benet.org
mydomain = benet.org
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.1.0/24, 127.0.0.0/8
/usr/local/postfix/sbin/postfix start
echo "/usr/local/postfix/sbin/postfix start" >> /etc/rc.local
cd /opt
rpm -ivh gdbm-devel-1.8.0-26.2.1.i386.rpm
ln -s /usr/local/mysql/bin/mysql_config /usr/bin/mysql_config
tar -jxvf courier-authlib-0.59.3.tar.bz2
cd courier-authlib-0.59.3
./configure \
--prefix=/usr/local/courier-authlib \
--sysconfdir=/etc \
--with-mailuser=postfix \
--with-mailgroup=postfix \
--without-authpam \
--without-authldap \
--without-authpwd \
--without-authshadow \
--without-authvchkpw \
--without-authpgsql \
--with-authmysql \
--with-mysql-libs=/usr/local/mysql5/lib \
--with-mysql-includes=/usr/local/mysql5/include \
--with-redhat \
--with-authmysqlrc=/etc/authmysqlrc \
--with-authdaemonrc=/etc/authdaemonrc \
CFLAGS="-march=i686 -O2 -fexpensive-optimizations" \
CXXFLAGS="-march=i686 -O2 -fexpensive-optimizations"
chmod 755 /usr/local/courier-authlib/var/spool/authdaemon
cp /etc/authdaemonrc.dist /etc/authdaemonrc
cp /etc/authmysqlrc.dist /etc/authmysqlrc
ln -s /usr/local/courier-authlib/bin/courierauthconfig /usr/bin/courierauthconfig
ln -sv /usr/local/courier-authlib/include/* /usr/include/
cp /opt/courier-authlib-0.59.3/courier-authlib.sysvinit /etc/init.d/courier-authlib
chmod 755 /etc/init.d/courier-authlib
chkconfig --add courier-authlib
chkconfig --level 2345 courier-authlib on
ldconfig -v
service courier-authlib start (启动服务)
cd /opt
tar jxvf courier-imap-4.1.3.tar.bz2
cd courier-imap-4.1.3
./configure --prefix=/usr/local/courier-imap --with-redhat --enable-unicode --disable-root-check --with-trashquota --without-ipv6 CPPFLAGS='-I/usr/local/ssl/include/openssl -I/usr/local/courier-authlib/include' LDFLAGS='-L/usr/local/courier-authlib/lib/courier-authlib' COURIERAUTHCONFIG='/usr/local/courier-authlib/bin/courierauthconfig'
make
make install
cp /usr/local/courier-imap/etc/imapd-ssl.dist /usr/local/courier-imap/etc/imapd-ssl
cp /usr/local/courier-imap/etc/pop3d.dist /usr/local/courier-imap/etc/pop3d
cp /usr/local/courier-imap/etc/pop3d-ssl.dist /usr/local/courier-imap/etc/pop3d-ssl
chown -R postfix /var/mailbox
cp /opt/courier-imap-4.1.3/courier-imap.sysvinit /etc/rc.d/init.d/courier-imapd
chmod 755 /etc/rc.d/init.d/courier-imapd
chkconfig --add courier-imapd
chkconfig --level 2345 courier-imapd on
service courier-imapd start
pwcheck_method: authdaemond
log_level: 3
mech_list:PLAIN LOGIN
authdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket
cd /opt
tar zxvf pcre-7.2.tar.gz
cd pcre-7.2
./configure
make
make install
cd /opt
groupadd -g 1001 vmail
useradd -g vmail -u 1001 -M -s /sbin/nologin vmail
tar jxvf maildrop-2.0.4.tar.bz2
cd maildrop-2.0.4
./configure --prefix=/usr/local/maildrop --enable-sendmail=/usr/sbin/sendmail --enable-trusted-users='root vmail' --enable-syslog=1 --enable-maildirquota --enable-maildrop-uid=1001 --enable-maildrop-gid=1001 --with-trashquota --with-dirsync
make
make install
cp /usr/local/maildrop/bin/maildrop /usr/bin/maildrop
chmod +x /usr/bin/maildrop
##################(20)Webmail安装配置##########################################
cd /opt
tar -zxvf extmail-1.0.1.tar.gz
mkdir -pv /var/www/extsuite
mv extmail-1.0.1 /var/www/extsuite/extmail
cp /opt/config/httpd.conf-2 /etc/httpd/httpd.conf
cp /opt/config/webmail.cf /var/www/extsuite/extmail/webmail.cf
killall httpd
/usr/local/apache/bin/apachectl start
#Extman的管理员登陆校验码需要perl-GD模块,而perl-GD需要gd,(gd已经安装)
cd /opt
tar -zxvf GD-2.35.tar.gz
cd GD-2.35
perl Makefile.PL
make
make install
SYS_CAPTCHA_ON = 1 //改为0 表示关闭验证码
tar -zxvf extman-0.2.3.tar.gz
mv extman-0.2.3 /var/www/extsuite/extman
/usr/local/mysql5/bin/mysql -u root -p5201314 < /var/www/extsuite/extman/docs/extmail.sql
/usr/local/mysql5/bin/mysql -u root -p5201314 < /var/www/extsuite/extman/docs/init.sql
install HTML::KTemplate
install DBI #DBI-1.607.tar.gz
install Unix::Syslog #Unix-Syslog-1.1.tar.gz
install FCGI #FCGI-0.67.tar.gz
install DBD::mysql #DBD-mysql-4.008.tar.gz
chmod -p 777 /var/mailbox
cp /opt/config/webman.cf /var/www/extsuite/extman/webman.cf
mkdir /tmp/extman
chmod 777 /tmp/extman
#[url]http://192.168.8.151/extman [/url] user:root@extmail.org pwd:extmail*123*
##增加域出错:DBD::mysql::db do failed: INSERT command denied to user 'extmail'@'localhost' for table 'domain' at /var/www/extsuite/extman/libs/Ext/Mgr/MySQL.pm line 359.
##解决办法:
grant all privileges on *.* to 'extmail'@'localhost' identified by 'extmail' with grant option;
##解决办法:
perl -MCPAN -e shell
install Time::HiRes #Time-HiRes-1.9715.tar.gz
install File::Tail #File-Tail-0.99.3.tar.gz
安装Time::HiRes
#tar zxvf Time-HiRes-1.9707.tar.gz
#cd Time-HiRes-1.9707
#perl Makefile.PL
#make
#make test
#make install
#tar zxvf File-Tail-0.99.3.tar.gz
#cd File-Tail-0.99.3
#perl Makefile
#make
#make test
#make install
tar zxvf cgilib-0.5.tar.gz
cd cgilib-0.5
make
cp libcgi.a /usr/local/lib
cp cgi.h /usr/include
tar zxvf rrdtool-1.2.23.tar.gz
cd rrdtool-1.2.23
./configure --prefix=/usr/local/rrdtool
make
make install
ln -sv /usr/local/rrdtool/lib/perl/5.8.5/i386-linux-thread-multi/auto/RRDs/RRDs.so /usr/lib/perl5/5.8.5/i386-linux-thread-multi/
ln -sv /usr/local/rrdtool/lib/perl/5.8.5/RRDp.pm /usr/lib/perl5/5.8.5
ln -sv /usr/local/rrdtool/lib/perl/5.8.5/i386-linux-thread-multi/RRDs.pm /usr/lib/perl5/5.8.5
cp -r /usr/local/rrdtool/lib/perl/5.8.8/i386-linux-thread-multi/* /usr/lib/perl5/5.8.8/i386-linux-thread-multi/
cp -r /var/www/extsuite/extman/addon/mailgraph_ext /usr/local
/ usr/local/mailgraph_ext/mailgraph-init start
/usr/local/mailgraph_ext/qmonitor-init start
echo "/usr/local/mailgraph_ext/mailgraph-init start" >> /etc/rc.local
echo "/usr/local/mailgraph_ext/qmonitor-init start" >> /etc/rc.local