Redhat 5.4搭建Extmail邮件系统

一:环境: redhat5.4 32位系统
二:操作系统安装请参考(yourmail系统安装文件)
三:系统底层架构: LAMP平台
LAMP+phpMyAadmin+Extmail
四:实施步骤

拓扑图:

______________________________________________________________________________


______________________________________________________________________________
1:1检查Extmail系统所需的依赖包,软件包在系统盘去找即可。
libtermcap-2.0.8-46.1.i386.rpm
libtermcap-devel-2.0.8-46.1.i386.rpm
libxml2-2.6.26-2.1.2.8.i386.rpm
libxml2-devel-2.6.26-2.1.2.8.i386.rpm
libxml2-python-2.6.26-2.1.2.8.i386.rpm
openssl-0.9.8e-12.el5.i386.rpm
openssl-0.9.8e-12.el5.i686.rpm
openssl-devel-0.9.8e-12.el5.i386.rpm
openssl-perl-0.9.8e-12.el5.i386.rpm
glib-1.2.10-20.el5.i386.rpm
gd-progs-2.0.33-9.4.el5_1.1.i386.rpm
gdm-docs-2.16.0-56.el5.i386.rpm
gdk-pixbuf-0.22.0-25.el5.i386.rpm
gdk-pixbuf-devel-0.22.0-25.el5.i386.rpm
gtk+-1.2.10-56.el5.i386.rpm
gtk+-devel-1.2.10-56.el5.i386.rpm
lm_sensors-2.10.7-4.el5.rpm
net-snmp-libs-5.3.2.2-7.el5.rpm
net-snmp-utils-5.3.2.2-7.el5.rpm
net-snmp-5.3.2.2-7.el5.rpm
freeradius-1.1.3-1.4.el5.rpm
freeradius-mysql-1.1.3-1.4.el5.rpm
libtool-ltdl-devel-1.5.22-6.1.i386.rpm
gamin-devel-0.1.7-8.el5.i386.rpm
expect-5.43.0-5.1.i386.rpm
expect-devel-5.43.0-5.1.i386.rpm
pcre-devel-6.6-2.el5_1.7.i386.rpm

______________________________________________________________________________
1:2 apache

vim /etc/resolv.conf
nameserver 192.168.0.100
rpm -e httpd --nodeps
tar -zxvf httpd-2.2.15.tar.gz -C /usr/src
cd /usr/src/httpd-2.2.15
配置
./configure --prefix=/usr/local/http --enable-rewrite --enable-so --enable-auth-digest --enable-cgi --with-

ssl=/usr/lib --enable-ssl --enable-suexec --with-suexec-docroot=/usr/local/http/htdocs 
编译安装
make && make install
cd /usr/local/http/bin
vim apachectl        添加如下
#! /bin/sh
# chkconfig: 35 85 15
# description: Apache is a World Wide Web Server

cp /usr/local/http/bin/apachectl /etc/init.d/httpd
chmod o+x /etc/init.d/httpd
chkconfig --add httpd
chkconfig httpd on
配置apache 用户和属组
useradd -M -s /sbin/nologin postfix
cd /usr/local/http/conf/
vim httpd.conf
User postfix
Group postfix
启动apache
service httpd start
http://localhost
______________________________________________________________________________
1.3 mysql
rpm -qa | grep mysql
mysql-connector-odbc-3.51.26r1127-1.el5
freeradius-mysql-1.1.3-1.4.el5
mysql-server-5.0.77-3.el5
libdbi-dbd-mysql-0.8.1a-1.2.2

rpm -e  mysql-connector-odbc-3.51.26r1127-1.el5 freeradius-mysql-1.1.3-1.4.el5 mysql-server-5.0.77-3.el5

libdbi-dbd-mysql-0.8.1a-1.2.2 --nodeps

yum -y install mysql-*
service mysqld start
chkconfig  mysqld on
mysqladmin  -u root password 123456

______________________________________________________________________________
1:4 PHP
安装libmcrypt mhash mcrypt解决无法加载mcrypt
(1)
tar -zxvf libmcrypt-2.5.8.tar.gz -C /usr/src/
cd /usr/src/libmcrypt-2.5.8/
./configure
Make
Make install
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig
(2)
tar -zxvf mhash-0.9.9.9.tar.gz -C /usr/src/
cd /usr/src/mhash-0.9.9.9/
./configure
Make
Make install
(3)
tar -zxvf mcrypt-2.6.8.tar.gz -C /usr/src/
cd /usr/src/mcrypt-2.6.8/
LD_LIBRARY_PATH=/usr/local/lib ./configure
Make
Make install

rpm -e php --nodeps
tar -zxvf php-5.2.13.tar.gz -C /usr/src
cd /usr/src/php-5.2.13
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/http/bin/apxs --with-config-file-

path=/usr/local/php --with-gd --with-freetype-dir --with-mysql --enable-sockets --enable-mbstring --with-jpeg-

dir --with-png-dir --disable-json --with-zlib --with-mysqli --with-mcrypt
make
make install
cp php.ini-dist /usr/local/php/php.ini
vim /usr/local/http/conf/httpd.conf     启用php模块
53 LoadModulephp5_module                   modules/libphp5.so                                                  

                              
54 AddType application/x-httpd-php .php                                      
167<IfModuledir_module>
168       DirectoryIndexindex.phpindex.html                                  
169</IfModule>

vim /usr/local/http/htdocs/index.php          
<?php
          phpinfo();
?>
service apache stop     关闭
service apache start    启动

http://localhost
______________________________________________________________________________
1:5 phpMyAdmin数据库管理软件
unzip phpMyAdmin-3.3.1-all-languages.zip -d /usr/local/http/htdocs/
cd /usr/local/http/htdocs/
mv phpMyAdmin-3.3.1-all-languages myadmin
cd phpMyAdmin/
cp config.sample.inc.php config.inc.php
vim config.inc.php
18 $cfg['blowfish_secret'] = '123456'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
service httpd stop
service httpd start

http://localhost/myadmin
______________________________________________________________________________