FJ集團企業級郵件服務器——IRedMail服務器安裝與配置

 

1、iRedMail安裝以前的準備工做:php

1)檢查服務器FQDN :node

clip_p_w_picpath002

2)檢查2個hostname文件:apache

clip_p_w_picpath004 clip_p_w_picpath006

3)yum源構建:ubuntu

將/etc/yum.repos.d/下的全部yum倉庫開啓(.repo擴展名的文件),即把enabled=1,以下圖所示:centos

(1)建立CentOS文件目錄、掛載光盤:sass

mkdir /media/CentOS //建立文件目錄CentOS,後面安裝iRedMail服務器要用到!bash

mount /dev/cdrom /media/CentOS //掛載之服務器

cd /media/CentOS --- ll 查看之:ide

cd /etc/yum.repos.dpost

vi CentOS-Base.repo //絕對路徑是: vi /etc/yum.repos.d/CentOS-Base.repo

clip_p_w_picpath008

vi /etc/yum.repos.d/CentOS-Media.repo

clip_p_w_picpath010

2、iRedMail服務器安裝:

1)編譯安裝:

mkdir /root/mail

mount /dev/hdc /media/

ll /media/

cp /media/iRedMail-0.7.4.tar.bz2 /root/mail

cd /root/mail && ll

tar –jxvf iRedMail-0.7.4.tar.bz2 -C /usr/local/src

clip_p_w_picpath012

若出現以下圖所示報錯:

備註: 下圖中的5個組件光盤中沒有,需到網上下載,可是域名iredmail.org被牆了:)故修改成IP址:173.254.22.21

clip_p_w_picpath014

解決方法1:

重點:先下載5個組件!將下圖紅框中的5個網址複製到IE中,回車!

< INFO > + 1 of 5: http://173.254.22.21/yum/misc/iRedAPD-1.3.6.tar.bz2

< INFO > + 2 of 5: http://173.254.22.21/yum/misc/iRedAdmin-0.1.6.tar.bz2

< INFO > + 3 of 5: http://173.254.22.21/yum/misc/roundcubemail-0.7.tar.gz

< INFO > + 4 of 5: http://173.254.22.21/yum/misc/phpldapadmin-1.2.2.tgz

< INFO > + 5 of 5: http://173.254.22.21/yum/misc/phpMyAdmin-3.4.8-all-languages.tar.bz2

clip_p_w_picpath016

簡單的複製方法:

[root@mail misc]# cd /media/

[root@mail media]# cp -p * /usr/local/src/iRedMail-0.8.0/pkgs/misc/

[root@mail media]# cd /usr/local/src/iRedMail-0.8.0/pkgs/misc/

[root@mail misc]# ll

total 9856

-r-xr-xr-x 1 root root 459487 Jun 12 2012 iRedAdmin-0.1.7.tar.bz2

-r-xr-xr-x 1 root root 16300 Jun 12 2012 iRedAPD-1.3.7.tar.bz2

-r-xr-xr-x 1 root root 1415565 Jun 13 2012 phpldapadmin-1.2.2.tgz

-r-xr-xr-x 1 root root 4666051 Jun 12 2012 phpMyAdmin-3.4.9-all-languages.tar.bz2

-r-xr-xr-x 1 root root 778547 Jun 12 2012 phpPgAdmin-5.0.4.tar.bz2

-r-xr-xr-x 1 root root 2714219 Jun 12 2012 roundcubemail-0.7.2.tar.gz [root@mail misc]#

解決方法2:

重點: 將/usr/local/src/iRedMail-0.7.4/pkgs/get_all.sh中的iredmail.org替換爲173.254.22.21以下圖所示:

clip_p_w_picpath018

clip_p_w_picpath020

clip_p_w_picpath022

//下面原來沒有設置:

clip_p_w_picpath024

clip_p_w_picpath026

clip_p_w_picpath028

clip_p_w_picpath030

//掛載光盤緣由是其餘組件光盤中都有!除了上面的5個組件外J

[root@mail ~]# mount /dev/hdc /media/CentOS/ //掛載光盤

mount: block device /dev/hdc is write-protected, mounting read-only

[root@mail ~]# cd /usr/local/src/iRedMail-0.7.4/pkgs/

[root@mail pkgs]# ll

total 36

-rw-r--r-- 1 root root 10836 Jun 4 21:53 get_all.sh

-rw-r--r-- 1 root root 328 Jan 8 23:44 MD5.misc

-rw-r--r-- 1 root root 58 Jan 8 23:44 MD5.opensuse

-rw-r--r-- 1 root root 188 Jan 8 23:44 MD5.ubuntu.lucid

drwxr-xr-x 2 root root 4096 Jun 4 21:33 misc

drwxr-xr-x 2 root root 4096 Jun 3 18:58 pkgs

-rw-r--r-- 1 root root 140 Jan 8 23:44 SHASUM.freebsd.misc

[root@mail pkgs]# bash get_all.sh

< INFO > Generating yum repository ...

< INFO > Fetching Source Tarballs ...

< INFO > + 1 of 5: http://173.254.22.21/yum/misc/iRedAPD-1.3.6.tar.bz2

< INFO > + 2 of 5: http://173.254.22.21/yum/misc/iRedAdmin-0.1.6.tar.bz2

< INFO > + 3 of 5: http://173.254.22.21/yum/misc/roundcubemail-0.7.tar.gz

< INFO > + 4 of 5: http://173.254.22.21/yum/misc/phpldapadmin-1.2.2.tgz

< INFO > + 5 of 5: http://173.254.22.21/yum/misc/phpMyAdmin-3.4.8-all-languages.tar.bz2

< INFO > Validate Packages ... [ OK ]

< INFO > Installing package(s): dialog.x86_64

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: mirror.bit.edu.cn

* c5-media:

* centosplus: mirror.bit.edu.cn

* extras: mirror.bit.edu.cn

* updates: mirror.bit.edu.cn

c5-media | 1.3 kB 00:00

c5-media/primary | 1.2 MB 00:00

c5-media 3595/3595

centosplus | 1.9 kB 00:00

centosplus/primary_db | 53 kB 00:01

contrib | 1.9 kB 00:00

contrib/primary_db | 1.1 kB 00:00

extras | 2.1 kB 00:00

iRedMail | 951 B 00:00

iRedMail/primary | 56 kB 00:00

iRedMail 179/179

iRedMail-Dovecot-12 | 951 B 00:00

iRedMail-Dovecot-12/primary | 5.3 kB 00:00

iRedMail-Dovecot-12 17/17

updates | 1.9 kB 00:00

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package dialog.x86_64 0:1.0.20051107-1.2.2 set to be updated

--> Finished Dependency Resolution

 

Dependencies Resolved

 

=========================================================================================

Package Arch Version Repository Size

=========================================================================================================================

Installing:

dialog x86_64 1.0.20051107-1.2.2 base 165 k

 

Transaction Summary

=========================================================================================================================

Install 1 Package(s)

Upgrade 0 Package(s)

 

Total download size: 165 k

Downloading Packages:

dialog-1.0.20051107-1.2.2.x86_64.rpm | 165 kB 00:04

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897

base/gpgkey | 1.5 kB 00:00

Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <centos-5-key@centos.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : dialog 1/1

 

Installed:

dialog.x86_64 0:1.0.20051107-1.2.2

 

Complete!

********************************************************

* All tasks had been finished successfully. Next step:

*

* # cd ..

* # bash iRedMail.sh

*

********************************************************

 

[root@mail pkgs]# cd ..

[root@mail iRedMail-0.7.4]# bash iRedMail.sh

clip_p_w_picpath032

解決方法:

軟件包衝突,系統已經安裝了openldap 的舊版本

方法1:建議先經過 yum update 升級系統,再安裝 iRedMail

yum update --exclude=openldap

方法2:卸載掉衝突的i386

//找出衝突的軟:

[root@mail iRedMail-0.7.4]# rpm -q openldap --qf '%{NAME} %{VERSION} %{ARCH}'

openldap 2.3.43 x86_64

openldap 2.3.43 i386

[root@mail iRedMail-0.7.4]#

//卸載掉衝突的i386

clip_p_w_picpath034

注:從下往上依次卸載!可能還會出現別的依賴關係:)故以下圖所示加 --nodeps

clip_p_w_picpath036

3、iRedMail服務器的配置:

一、建立少許用戶:

clip_p_w_picpath038

clip_p_w_picpath040

二、批量建立用戶:

cd /usr/local/src/iRedMail-0.7.4/tools/create_mail_user_OpenLDAP.sh

clip_p_w_picpath042

clip_p_w_picpath044

clip_p_w_picpath046

//檢驗批量建立用戶是否成功 https://192.168.1.225/phpldapadmin

clip_p_w_picpath048

clip_p_w_picpath050

三、支持大附件:

1)郵件客戶端能發送大附件(eg: outlook) 注:接收方也要能接收大附件,纔可,切記!

clip_p_w_picpath052

[root@mail ~]# postconf -e message_size_limit='104857600'

[root@mail ~]# /etc/init.d/postfix restart

Shutting down postfix: [ OK ]

Starting postfix: [ OK ]

[root@mail ~]# service postfix restart

Shutting down postfix: [ OK ]

Starting postfix: [ OK ]

[root@mail ~]#

2)WebMail能發送大附件

//NO.1 vi /etc/php.ini

clip_p_w_picpath054

查找php.ini的絕對路徑:

clip_p_w_picpath056

clip_p_w_picpath058

vi /etc/php.ini

clip_p_w_picpath060

clip_p_w_picpath062

//NO.2 vi /var/www/roundcubemail-0.7/.htaccess

clip_p_w_picpath064

vi /var/www/roundcubemail-0.7/.htaccess

clip_p_w_picpath066

從新啓動apache服務:

clip_p_w_picpath068

添加apache爲系統服務和開機器自啓動
# chkconfig --add httpd
# chkconfig httpd on

4、停用殺毒和發垃圾的功能(Aavisd+clamAV+SpamAssassin)

//查找main.cf的絕對路徑:

clip_p_w_picpath070

註釋掉下面的1行:

clip_p_w_picpath072

clip_p_w_picpath074

clip_p_w_picpath076

clip_p_w_picpath078

1、能收到郵件,但不能發送郵件!

clip_p_w_picpath080

下面是上圖報錯時,第1745行內容,以下圖所示:

clip_p_w_picpath082

思考:

能收,不能發送???接收是pop3服務,發送是SMTP服務!因而,咱們檢查檢查,以下圖所示:

clip_p_w_picpath084

通過上面設置後,收發自如!!!

相關文章
相關標籤/搜索