日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

iredmail郵件系統(tǒng)離線搭建手冊(cè)-從零到無(wú)

 行者花雕 2022-05-29 發(fā)布于北京

--時(shí)間:2020年10月20日

--作者:飛翔的小胖豬

概述

前言

iRedMail 是一個(gè)基于 Linux/BSD 系統(tǒng)的零成本、功能完備、成熟的郵件服務(wù)器解決方案。iRedMail 是一個(gè)開(kāi)源、免費(fèi)的項(xiàng)目。以 GPL(v2)協(xié)議發(fā)布。

文檔初衷

在我實(shí)際生產(chǎn)環(huán)境中需要搭建一套郵件服務(wù)器,百度了一下聽(tīng)說(shuō)iredmail不錯(cuò),一步一步來(lái)唄。大致流程如下:

1.先在自己環(huán)境下做測(cè)試,如果能成功再搞到生產(chǎn)環(huán)境中。

2.打開(kāi)其官方網(wǎng)站根據(jù)自己實(shí)際的設(shè)備環(huán)境(操作系統(tǒng))找到合適的安裝步驟。(盡量要英文手冊(cè))

3.根據(jù)你所看到的步驟提示一步一步的走,然后就安裝好了。這有一個(gè)前提你的安裝環(huán)境必須與互聯(lián)網(wǎng)相通。

4.通過(guò)觀察iredmail的安裝實(shí)時(shí)提示信息發(fā)現(xiàn)他會(huì)去互聯(lián)網(wǎng)中下載很多東西,可我的內(nèi)網(wǎng)環(huán)境不能連通互聯(lián)網(wǎng)呀??戳艘幌鹿倬W(wǎng)上又沒(méi)有提供離線安裝包下載,好吧看來(lái)要消耗一波腦細(xì)胞了。

5.通過(guò)一整天的各種嘗試終于然我找到一套可行的離線安裝方式。

環(huán)境準(zhǔn)備

系統(tǒng)及軟件:

數(shù)據(jù)準(zhǔn)備:

安裝包下載:

該安裝包是由本人從iredmail官網(wǎng)上下載的文件然后制作的離線安裝軟件包?,F(xiàn)放在百度網(wǎng)盤(pán)中,該篇文檔也是使用該包來(lái)完成安裝的。

鏈接:https://pan.baidu.com/s/1yaOS8CciAjFjeN5IHIW3-w

ps:可能只適用與centos 7.6+iredmail-1.3.1的環(huán)境,其他操作系統(tǒng)及軟件版本也沒(méi)測(cè)過(guò)。

包文件說(shuō)明:

 軟件包主要分為4塊。

.官網(wǎng)軟件包:iRedMail-1.3.1.tar.gz  + misc

.安裝所需的epel源中的rpm文件:yum_down_soft.tar.gz

.cvd病毒庫(kù):cvd

.python2及3的各種必要模塊:python

步驟

安裝配置操作系統(tǒng)

安裝操作系統(tǒng)

操作系統(tǒng)安裝這一步就不介紹了,請(qǐng)自行百度謝謝!?。∏杏浳矣玫氖荂entos 7.6的系統(tǒng),安裝軟件選擇最簡(jiǎn)潔的最小化安裝即可。

 

配置系統(tǒng)

進(jìn)入到操作系統(tǒng)過(guò)后需要關(guān)閉selinux及firewalld,同時(shí)要設(shè)置機(jī)器主機(jī)名、掛載本地repo鏡像。

(網(wǎng)絡(luò)配置這些基礎(chǔ)配置自行百度)

.設(shè)置主機(jī)名

1.#使用名設(shè)置主機(jī)名為我們事先規(guī)劃好的名字
[root@test1 ~]# hostnamectl set-hostname test1. [root@test1 ~]# hostname
test1.


2.修改/etc/hosts文件把主機(jī)名添加到文本中,需要添加到最前面
[root@test1 ~]# vim /etc/hosts

127.0.0.1   test1. localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

.關(guān)閉selinux

1.命令臨時(shí)設(shè)置selinux為只記錄
[root@test1 ~]# setenforce 0 [root@test1 ~]# getenforce Disabled

2.修改/etc/selinux/config文件中的SELINUX=enforcing為SELINUX=disabled
[root@test1 ~]# vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

.關(guān)閉firewalld

#停止firewalld服務(wù)同時(shí)設(shè)置其開(kāi)機(jī)不自動(dòng)啟動(dòng),設(shè)置不能被其他應(yīng)用調(diào)用。
[root@test1 ~]# systemctl stop firewalld [root@test1 ~]# systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. [root@test1 ~]# systemctl mask firewalld

.掛載本地光盤(pán)鏡像

#掛載本地光盤(pán)到/mnt目錄中
[root@test1 ~]# mount /dev/sr0 /mnt
mount: /dev/sr0 is write-protected, mounting read-only
#刪除/etc/yum.repos.d/下系統(tǒng)自帶的repo文件
[root@test1 ~]# cd /etc/yum.repos.d/
[root@test1 yum.repos.d]# rm -rf CentOS-*
#新建編輯一個(gè)名為local_yum.repo的yum源文件
[root@test1 ~]# vim /etc/yum.repos.d/local_yum.repo
[yum_local]
name=yum_local
enabled=1
gpgcheck=0
baseurl=file:///mnt/
[root@test1 yum.repos.d]# yum clean all
[root@test1 yum.repos.d]# yum makecache
[root@test1 yum.repos.d]# yum repolist

準(zhǔn)備安裝環(huán)境

解壓文件

通過(guò)本人分享的百度鏈接下載得到安裝軟件包,然后解壓到根目錄下。

1.解壓總的安裝包
[root@test1 ~]# ll /iredmail.tar.gz -rw-r--r-- 1 root root 487738299 Oct 20 11:47 /iredmail.tar.gz [root@test1 ~]# [root@test1 ~]# [root@test1 ~]# tar -zxvf /iredmail.tar.gz -C / #解壓壓縮包到根目錄下
[root@test1 ~]# cd /soft
[root@test1 soft]# ll
total 194128
drwxr-xr-x 2 root root        59 Oct 20 11:42 cvd
-rw-r--r-- 1 root root    232203 Oct 16 08:47 iRedMail-1.3.1.tar.gz
drwxr-xr-x 2 root root       226 Oct 20 11:44 misc
drwxr-xr-x 4 root root        56 Oct 20 11:43 python
-rw-r--r-- 1 root root 198550344 Oct 19 16:50 yum_down_soft.tar.gz

2.解壓rpm軟件包。
[root@test1 soft]# tar -zxvf yum_down_soft.tar.gz

3.解壓iredmail文件
[root@test1 soft]# tar -zxvf iRedMail-1.3.1.tar.gz
[root@test1 soft]# ll
total 194152
drwxr-xr-x  2 root root        59 Oct 20 11:42 cvd
drwxr-xr-x 10 root root       193 Sep 22 05:34 iRedMail-1.3.1
-rw-r--r--  1 root root    232203 Oct 16 08:47 iRedMail-1.3.1.tar.gz
drwxr-xr-x  2 root root       226 Oct 20 11:44 misc
drwxr-xr-x  4 root root        56 Oct 20 11:43 python
drwxr-xr-x  3 root root     20480 Oct 18 23:32 yum_down_soft
-rw-r--r--  1 root root 198550344 Oct 19 16:50 yum_down_soft.tar.gz

修改部分腳本

在iredmail安裝腳本中會(huì)自動(dòng)生成一個(gè)sogo的repo文件每次。在外網(wǎng)環(huán)境下他會(huì)通過(guò)自動(dòng)生成的repo文件去找到需要的包并進(jìn)行下載。在內(nèi)網(wǎng)中則會(huì)因?yàn)闊o(wú)法連接外網(wǎng)而安裝報(bào)錯(cuò)。

我們需要修改其自動(dòng)生成repo的語(yǔ)句改為我們本地的路徑。

在/soft/iRedMail-1.3.1n>/functions/packages.sh文件中注釋掉baseurl=${SOGO_PKG_MIRROR}/SOGo/nightly/${SOGO_VERSION}/rhel/${DISTRO_VERSION}/\$basearch行(大概在文件的408行左右),然后添加一行新數(shù)據(jù)指定生成的repo路徑為本地路徑。
[root@test1 soft]# vim /soft/iRedMail-1.3.1/functions/packages.sh
cat > ${YUM_REPOS_DIR}/sogo.repo <<EOF
[SOGo]
name=Inverse SOGo Repository
enabled=1
gpgcheck=0

# SOGo v3 stable release.
# WARNING: A proper support contract from Inverse is required:
# https:///support/index.html#support-plans
#baseurl=${SOGO_PKG_MIRROR}/SOGo/release/${SOGO_VERSION}/rhel/${DISTRO_VERSION}/\$basearch

# SOGo v3 nightly builds
#baseurl=${SOGO_PKG_MIRROR}/SOGo/nightly/${SOGO_VERSION}/rhel/${DISTRO_VERSION}/\$basearch #被注釋掉的行
baseurl=file:///soft/yum_down_soft #新添加的行,根據(jù)前文所知我的rpm包放在/soft/yum_down_soft目錄下
EOF

拷貝軟件到指定位置

拷貝安裝過(guò)程中的軟件到指定的位置,如果沒(méi)有相關(guān)文件夾請(qǐng)自行創(chuàng)建。
拷貝/soft/misc目錄到/soft/iRedMail-1.3.1/pkgs/
[root@test1 soft]# cp  -rp  /soft/misc /soft/iRedMail-1.3.1/pkgs/
[root@test1 soft]# ll /soft/iRedMail-1.3.1/pkgs/misc/ #確認(rèn)復(fù)制成功
total 42972
-rw-r--r-- 1 root root   395656 Oct 20 11:44 iRedAdmin-1.0.tar.bz2
-rw-r--r-- 1 root root   102870 Oct 20 11:44 iRedAPD-4.3.tar.gz
-rw-r--r-- 1 root root  1849829 Oct 20 11:44 libsodium-1.0.18-stable.tar.gz
-rw-r--r-- 1 root root    40622 Oct 20 11:44 mlmmjadmin-3.0.tar.gz
-rwxr-xr-x 1 root root 34464172 Oct 20 11:44 netdata-v1.23.1.gz.run
-rw-r--r-- 1 root root  7031947 Oct 20 11:44 roundcubemail-1.4.7-complete.tar.gz
-rw-r--r-- 1 root root   105522 Oct 20 11:44 webpy-0.51.tar.gz

 

正式安裝iredmail

一切準(zhǔn)備就緒那就可以安裝了,安裝的步驟和官網(wǎng)的一模一樣但有幾部又有不同。建議打開(kāi)兩個(gè)終端,一個(gè)用來(lái)安裝iredmail一個(gè)cd到/etc/yum.repos.d目錄下準(zhǔn)備修改repo文件。

[root@test1 ~]# cd /soft/iRedMail-1.3.1/
[root@test1 iRedMail-1.3.1]# bash iRedMail.sh
然后就是大帕拉的各種提示,此時(shí)應(yīng)該會(huì)報(bào)錯(cuò)如下:
   5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=iRedMail.skip_if_unavailable=true

failure: repodata/repomd.xml from iRedMail: [Errno 256] No more mirrors to try.
https://dl./yum/rpms/7/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: dl.; Unknown error"
[ INFO ] Checking configuration file: /soft/iRedMail-1.3.1/config ...[ INFO ] NOT FOUND. Launching installation wizard.
/soft/iRedMail-1.3.1/dialog/config_via_dialog.sh: line 44: dialog: command not found

修改/etc/yum.repos.d/iRedMail.repo為如下內(nèi)容后再執(zhí)行安裝。
[root@test1 ~]# vim /etc/yum.repos.d/iRedMail.repo
[iRedMail]
name=iRedMail
#baseurl=https://dl./yum/rpms/$releasever/
baseurl=file:///soft/yum_down_soft
enabled=1
gpgcheck=0
#exclude=postfix*
priority=99
module_hotfixes=1
[root@test1 ~]# cd /soft/iRedMail-1.3.1/
[root@test1 iRedMail-1.3.1]# bash iRedMail.sh

直接鼠標(biāo)點(diǎn)擊<Yes>進(jìn)入下一步。

 定義你的郵件存儲(chǔ)路徑,自定義的,如果存儲(chǔ)比較有空那么可以掛一張新盤(pán)來(lái)作為郵件存儲(chǔ)。

選擇安裝郵件服務(wù)器運(yùn)行web服務(wù)。

 郵件中的用戶管理使用mysql數(shù)據(jù)庫(kù)。

 設(shè)置mysql的密碼,自定義的。

 創(chuàng)建一個(gè)域名。

 設(shè)置郵件管理員的密碼。

 不管全選,具體選項(xiàng)功能看其后的英文注釋很清楚。

 再次確認(rèn)你的設(shè)置,確認(rèn)無(wú)誤后輸入Y敲回車(chē)?yán)^續(xù)安裝。

 

輸入了Y后,敲回車(chē),系統(tǒng)會(huì)進(jìn)行軟件包的安裝。

當(dāng)安裝停在/etc/firewalld/zones/iredmail.xm,with SSHD ports:22. [Y|n] 行時(shí)先不要?jiǎng)?。新開(kāi)一個(gè)終端進(jìn)行如下操作。

此處的命令請(qǐng)新開(kāi)一個(gè)終端執(zhí)行。
[root@test1 ~]# pip install --no-index --find-links  /soft/python/2  -r /soft/python/pip2.txt     #安裝python2的模塊
[root@test1 ~]# pip3 install --no-index --find-links  /soft/python/3  -r /soft/python/pip3.txt    #安裝python3的模塊


復(fù)制包內(nèi)的cvd病毒庫(kù)文件置/var/lib/clamav/下并修改所有者。
[root@test1 lib]# cp /soft/cvd/* /var/lib/clamav/ [root@test1 lib]# chown clamupdate:clamupdate /var/lib/clamav/* [root@test1 lib]# ll /var/lib/clamav/

以上的內(nèi)存執(zhí)行好了再回到之前的終端“Y”。

 

最后你可以類(lèi)似如下的信息,請(qǐng)從********************************************************************* URLs of installed web applications:處開(kāi)始復(fù)制下來(lái),或拍照,不然以后忘了。

然后根據(jù)提示重啟服務(wù)器完成安裝。

.................................
Reading CVD header (daily.cvd): Giving up on https://database.clamav.net... ******************************************************************** * URLs of installed web applications: * * - Roundcube webmail: https://test1./mail/ * - SOGo groupware: https://test1./SOGo/ * - netdata (monitor): https://test1./netdata/ * * - Web admin panel (iRedAdmin): https://test1./iredadmin/ * * You can login to above links with below credential: * * - Username: postmaster@ * - Password: 123456 * * ******************************************************************** * Congratulations, mail server setup completed successfully. Please * read below file for more information: * * - /soft/iRedMail-1.3.1/iRedMail.tips * * And it's sent to your mail account postmaster@. * ********************* WARNING ************************************** * * Please reboot your system to enable all mail services. * ********************************************************************

 

測(cè)試

* - Roundcube webmail: https://test1./mail/               #郵件收發(fā)web界面,所有人可登錄
* - SOGo groupware: https://test1./SOGo/                #郵件收發(fā)web界面,所有人可登錄
* - netdata (monitor): https://test1./netdata/              #很酷炫的一個(gè)資源監(jiān)控界面,使用域管理員登錄。
* - Web admin panel (iRedAdmin): https://test1./iredadmin/     #郵件管理web界面,使用域管理員登錄。用作管理郵件系統(tǒng),創(chuàng)建域、用戶什么的。。。。

請(qǐng)逐一建議檢查以上這4個(gè)界面是否可用。有問(wèn)題可以私信我。

 

總結(jié)

在內(nèi)網(wǎng)環(huán)境無(wú)法連接互聯(lián)網(wǎng)時(shí),想要在內(nèi)網(wǎng)中部署一套需要需要各種外部包和數(shù)據(jù)的軟件及應(yīng)用不是一件特別輕松的事。

針對(duì)這種情況一般有兩種方法。

  .找到軟件的所有依賴包和所需的數(shù)據(jù)下載打包起來(lái)在安裝的過(guò)程中手動(dòng)把需要的數(shù)據(jù)庫(kù)拷貝到指定的位置。

  .搭建套Docker環(huán)境,在互聯(lián)網(wǎng)的環(huán)境中使用容器事先軟件安裝部署,然后打包容器為image,在內(nèi)網(wǎng)環(huán)境中安裝docker環(huán)境,然后load一下之前打包好的鏡像,最后docker run一下就搞定了。

容器真香哈哈。

翻譯過(guò)來(lái)的中文操作文檔全是坑。

 

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類(lèi)似文章 更多