zimbra邮件系统
本文主要讲:
zimbra的安装
在安装过程中出现的错误及解决方法
zimbra一些命令
zimbra默认安装路径是:/opt/zimbra
一、安装zimbra
(1)网络架构图
DNS server:10.10.54.88
mail server:10.10.54.85(/opt/zimbra >= 5GB)
(2)设置DNS
即在主机10.10.54.88上:
[root@nan88 ~]# vim /etc/named.conf
zone "cat.com" IN {
type master;
file "named.cat.com";
};
[root@nan88 ~]# vim /var/named/named.cat.com
$TTL 600
@ IN SOA cat.com. root (2014030401 1H 15M 1W 1D);
@ IN NS cat.com.
@ IN MX 10 mail.cat.com. --10代表优先级
cat.com. IN A 10.10.54.87
mail.cat.com. IN A 10.10.54.87
(3)设置邮件服务器的resolv.conf和hosts文件
即在主机10.10.54.85上:
[root@nan85 ~]# hostname mail
[root@nan85 ~]# vim /etc/resolv.conf
nameserver 10.10.54.88
[root@nan85 ~]# vim /etc/hosts
10.10.54.85 mail.cat.com mail
--IP FQHN HN
[root@mail ~]# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=mail
注意:
如果你的/opt/zimbra不够5G需做做这一步!!!!!
(4)挂载磁盘
在mail server上操作
由于/opt/zimbra/需要最少5G空间,所以先挂载一块硬盘
##关闭虚拟机
Settings-->Storage-->Controller:SATA-->Add Hard Disk-->Create new disk-->8.00GB(最少5GB)-->Create-->OK
##开启虚拟机
##新增一个硬盘:
[root@mail ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xa5a5f8f6.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): n --写入n,增加
Command action
e extended
p primary partition (1-4)
p --写入p
Partition number (1-4): 2 --写入2
First cylinder (1-1044, default 1): --回车
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1044, default 1044): --回车
Using default value 1044
Command (m for help): w --写入w,保存退出
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
##格式化
[root@mail ~]# mkfs -t ext4 /dev/sdb2
##挂载
[root@mail ~]# mkdir /opt/zimbra
[root@mail ~]# mount /dev/sdb2 /opt/zimbra
##查看一下
[root@mail ~]# df -l
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 6192704 3957024 1921108 68% /
tmpfs 961340 0 961340 0% /dev/shm
/dev/sda1 198337 25833 162264 14% /boot
/dev/sda3 5160576 2635984 2262448 54% /usr
/dev/sdb2 8254240 149492 7685456 2% /opt/zimbra
##设置自动挂载
查看UUID
[root@mail ~]# dumpe2fs /dev/sdb2 |grep UUID
dumpe2fs 1.41.12 (17-May-2010)
Filesystem UUID: cfd353cc-5e3a-4fed-bbf7-df298f1d0a04
[root@mail ~]# vim /etc/fstab
[root@mail ~]# init 6
正式安装!!!!!
(5)安装zimbra
安装依赖包,不安装会出现错误:
[root@mail mail]# yum install nc.x86_64
[root@mail mail]# yum install sysstat.x86_64
正式安装:
[root@mail mail]# tar xvf zcs-8.0.6_GA_5922.RHEL6_64.20131203103705.tgz
[root@mail mail]# cd zcs-8.0.6_GA_5922.RHEL6_64.20131203103705
[root@mail zcs-8.0.6_GA_5922.RHEL6_64.20131203103705]# ./install.sh
Do you agree with the terms of the software license agreement? [N] Y --输入Y
Do you agree with the terms of the software license agreement? [N] Y --输入Y
Select the packages to install
Install zimbra-ldap [Y] --回车,下同
Install zimbra-logger [Y]
Install zimbra-mta [Y]
Install zimbra-snmp [Y]
Install zimbra-store [Y]
Install zimbra-apache [Y]
Install zimbra-spell [Y]
Install zimbra-memcached [N] Y --输入Y
Install zimbra-proxy [N] --回车
Checking required space for zimbra-core
Checking space for zimbra-store
Installing:
zimbra-core
zimbra-ldap
zimbra-logger
zimbra-mta
zimbra-snmp
zimbra-store
zimbra-apache
zimbra-spell
zimbra-memcached
The system will be modified. Continue? [N] Y --修改系统,输入Y继续
...等几分钟
出现错误:
DNS ERROR resolving MX for mail.cat.com
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes]
解决方法:
再开一个远程登录10.10.54.85/88查看
检查DNS发现没错误,输入N
出现错误:
Port conflict detected: 25 (zimbra-mta)
Port conflict detected: 25 (zimbra-mta)
Port conflicts detected! - Press Enter/Return key to continue
意思是端口冲突
解决方法:
再开一个远程登录10.10.54.85关闭postfix
[root@mail ~]# /etc/init.d/postfix stop
敲击任意键
Address unconfigured (**) items (? - help) 3 --输入3更改admin密码
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@mail.cat.com
** 4) Admin Password UNSET
5) Anti-virus quarantine user: virus-quarantine.uiwqbnk2ck@mail.cat.com
6) Enable automated spam training: yes
7) Spam training user: spam._e0guhokfu@mail.cat.com
8) Non-spam(Ham) training user: ham.plyayfna@mail.cat.com
9) SMTP host: mail.cat.com
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: https
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://mail.cat.com:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@mail.cat.com
24) Version update source email: admin@mail.cat.com
Select, or 'r' for previous menu [r] 4 --输入4
Password for admin@mail.cat.com (min 6 characters): [v9xLlup4Oo] 123456 --输入密码
Select, or 'r' for previous menu [r] 12
Please enter the web server mode (http,https,both,mixed,redirect) [https] mixed
Select, or 'r' for previous menu [r] r --输入r,回到主菜单
Main menu
1) Common Configuration:
2) zimbra-ldap: Enabled
3) zimbra-store: Enabled
4) zimbra-mta: Enabled
5) zimbra-snmp: Enabled
6) zimbra-logger: Enabled
7) zimbra-spell: Enabled
8) Default Class of Service Configuration:
r) Start servers after configuration yes
s) Save config to file
x) Expand menu
q) Quit
*** CONFIGURATION COMPLETE - press 'a' to apply
Select from menu, or press 'a' to apply config (? - help) a --输入a应用
Save configuration data to a file? [Yes] --回车
Save config in file: [/opt/zimbra/config.8735] --回车
Saving config in /opt/zimbra/config.8735...done.
The system will be modified - continue? [No] Yes --输入Yes
...等几分钟
Notify Zimbra of your installation? [Yes] N --安装通知zimbra,输入N
Configuration complete - press return to exit
(6)重启zimbra
先把本机的postfix关闭
#/etc/init.d/postfix stop
#chkconfig --level 2345 postfix off
#/etc/init.d/zimbra restart
(7)测试
在客户端上
修改
# vim /etc/resolv.conf
nameserver 10.10.54.88 --DNS IP
浏览器中输入“http://mail.cat.com/”
登录 用户名:admin 密码:123456 --第5步输入的密码
注意:如果能重启,浏览器出不来,重启机器,把postfix关闭!!!!!!!
#/etc/init.d/postfix stop
(8)邮件管理
管理后台
浏览器中输入“https://mail.cat.com:7071/”
用户名:admin 密码:123456 --第5步输入的密码
新建用户:
home-->Add Account
管理用户:
home-->Manage Account
二、在安装过程中出现的错误及解决方法
出现错误:
Checking for prerequisites...
FOUND: NPTL
MISSING: nc
FOUND: sudo-1.8.6p3-7
FOUND: libidn-1.18-2
FOUND: gmp-4.3.1-7
FOUND: /usr/lib64/libstdc++.so.6
Checking for suggested prerequisites...
FOUND: perl-5.10.1
MISSING: sysstat does not appear to be installed.
FOUND: sqlite
解决方法:
[root@mail ~]# yum install nc.x86_64
[root@mail ~]# yum install sysstat.x86_64
出现错误:
Checking required space for zimbra-core
Checking space for zimbra-store
/opt/zimbra requires at least 5GB of space to install.
0GB is not enough space to install.
Installation cancelled.
磁盘不足
解决方法:
如果不做第四步,就会出现这个问题
增加磁盘空间
三、zimbra一些命令
查看mysql密码
[root@mail bin]# /opt/zimbra/bin/zmlocalconfig -s |grep zimbra_mysqlzimbra_mysql_connector_maxActive = 100
zimbra_mysql_password = oY6zRTZhsfOv81YLzgWxAJQDuT7H
zimbra_mysql_user = zimbra
查看端口
//查看端口
[root@mail bin]# ps -ef |grep mysql
/data --plugin-dir=/opt/zimbra/mysql/lib/plugin --external-locking --log-error=/opt/zimbra/log/mysql_error.log --pid-file=/opt/zimbra/db/mysql.pid --socket=/opt/zimbra/db/mysql.sock --port=7306
查找mysql.sock
[root@mail bin]# find /opt/zimbra/ -name *.sock
/opt/zimbra/db/mysql.sock
登录mysql
/opt/zimbra/mysql/bin/mysql -uzimbra -poY6zRTZhsfOv81YLzgWxAJQDuT7H -P7306 --socket=/opt/zimbra/db/mysql.sock
删除zimbra
./install.sh -u