리눅스 짐브라(zimbra) 웹메일 서버 구축

1) 필요 라이브 러리 설치

yum -y install gcc-c++
yum -y install gcc
yum -y install make
yum -y install wget
yum -y install libtermcap-devel ncurses-devel
yum -y install make cmake
yum -y install gcc g++ cpp gcc-c++
yum -y install perl
yum -y install ncurses-devel
yum -y install bison
yum -y install zlib curl
yum -y install openssl openssl-devel
yum -y install bzip2-devel
yum -y install libtermcap-devel libc-client-devel
yum -y install wget unzip
yum -y install gmp sysstat

2) sendmail 및 postfix 실행 중단, 삭제

service sendmail stop
chkconfig sendmail off

yum remove postfix *

) 짐브라 설치시 기본 사용 Port

Remote Queue Manager : 22
Postfix : 25
HTTP : 80
POP3 : 110
IMAP : 143
LDAP : 389
HTTPS : 443
Mailboxd IMAP SSL : 993
Mailboxd POP SSL : 995
Mailboxd LMTP : 7025

4) 메일서버 호스트 이름 설정

cat /etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=mail.hostname.net
GATEWAY=192.168.0.1

5) /etc/hosts 파일 설정

cat /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

192.168.0.100 mail.hostname.net mail

6) 소스파일 다운로드

wget http://files2.zimbra.com/downloads/8.8.15_GA/zcs-8.8.15_GA_3140.RHEL5.20110329150824.tgz
tar xvf zcs-7.1.0_GA_3140.RHEL5.20110329150824.tgz
cd zcs-7.1.0_GA_3140.RHEL5.20110329150824

7) 짐브라 설치 실행

sh install.sh --platform-override

./install.sh

도메인 변경

이부분에서 도메인을 변경해주지 않으면, admin@mail.ps-ef.net 와 같은 서브도메인을 사용하는 꼴이 되버린다.

정확한 도메인으로 수정.

Change domain name? [Yes] yes
Create domain: [mail.ps-ef.net] ps-ef.net
MX: mail.ps-ef.net (210.114.223.192)
Interface: 210.114.223.192
Interface: 127.0.0.1
done.
Checking for port conflicts

정상적으로 MX 레코드값을 확인이 가능해졌다.(DNS에서 이부분은 미리 설정이 되어있어야된다.)

Main menu
1) Common Configuration:
2) zimbra-ldap: Enabled
3) zimbra-store: Enabled
+Create Admin User: yes
+Admin user to create: admin@ps-ef.net
******* +Admin Password UNSET
+Anti-virus quarantine user: virus-quarantine.ca7ovwmko@ps-ef.net
+Enable automated spam training: yes
+Spam training user: spam.dclvwzqamo@ps-ef.net
+Non-spam(Ham) training user: ham.90vqf3iex@ps-ef.net
+SMTP host: mail.ps-ef.net
+Web server HTTP port: 80
+Web server HTTPS port: 443
+Web server mode: http
+IMAP server port: 7143
+IMAP server SSL port: 7993
+POP server port: 7110
+POP server SSL port: 7995
+Use spell check server: yes
+Spell server URL: http://mail.ps-ef.net:7780/aspell.php
+Enable version update checks: TRUE
+Enable version update notifications: TRUE
+Version update notification email: admin@ps-ef.net
+Version update source email: admin@ps-ef.net
4) zimbra-mta: Enabled
5) zimbra-snmp: Enabled
6) zimbra-logger: Enabled
7) zimbra-spell: Enabled
8) zimbra-proxy: Enabled
9) Default Class of Service Configuration:
r) Start servers after configuration yes
s) Save config to file
x) Expand menu
q) Quit

Address unconfigured (**) items (? - help) 3

Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@ps-ef.net
** 4) Admin Password UNSET
5) Anti-virus quarantine user: virus-quarantine.ngn76dth@ps-ef.net
6) Enable automated spam training: yes
7) Spam training user: spam.feh2zm1ke@ps-ef.net
8) Non-spam(Ham) training user: ham.kqqbhmfx5@ps-ef.net
9) SMTP host: mail.ps-ef.net
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: http
13) IMAP server port: 7143
14) IMAP server SSL port: 7993
15) POP server port: 7110
16) POP server SSL port: 7995
17) Use spell check server: yes
18) Spell server URL: http://mail.ps-ef.net:7780/aspell.php
19) Enable version update checks: TRUE
20) Enable version update notifications: TRUE
21) Version update notification email: admin@ps-ef.net
22) Version update source email: admin@ps-ef.net

Select, or 'r' for previous menu [r] 4

기본 관리자(admin)패스워드 변경을 해줌.

Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@ps-ef.net
4) Admin Password set
5) Anti-virus quarantine user: virus-quarantine.ngn76dth@mail.ps-ef.net
6) Enable automated spam training: yes
7) Spam training user: spam.feh2zm1ke@ps-ef.net
8) Non-spam(Ham) training user: ham.kqqbhmfx5@ps-ef.net
9) SMTP host: mail.ps-ef.net
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: http
13) IMAP server port: 7143
14) IMAP server SSL port: 7993
15) POP server port: 7110
16) POP server SSL port: 7995
17) Use spell check server: yes
18) Spell server URL: http://mail.ps-ef.net:7780/aspell.php
19) Enable version update checks: TRUE
20) Enable version update notifications: TRUE
21) Version update notification email: admin@ps-ef.net
22) Version update source email: admin@ps-ef.net

Select, or 'r' for previous menu [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) zimbra-proxy: Enabled
9) 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
Save configuration data to a file? [Yes] yes
Save config in file: [/opt/zimbra/config.11937]
Saving config in /opt/zimbra/config.11937...done.
The system will be modified - continue? [No] yes
Operations logged to /tmp/zmsetup.02072014-182254.log
Setting local config values...done.
Setting up CA...done.
Deploying CA to /opt/zimbra/conf/ca ...done.
Creating SSL certificate...done.
Installing mailboxd SSL certificates...done.
Initializing ldap...done.
Setting replication password...done.
Setting Postfix password...done.
Setting amavis password...done.
Setting nginx password...done.
Creating server entry for mail.ps-ef.net...done.
Saving CA in ldap ...done.
Saving SSL Certificate in ldap ...done.
Setting spell check URL...done.
Setting service ports on mail.ps-ef.net...done.
Adding mail.ps-ef.net to zimbraMailHostPool in default COS...done.
Installing webclient skins...
tree...done.
lemongrass...done.
hotrod...done.
beach...done.
lavender...done.
steel...done.
bones...done.
bare...done.
sky...done.
waves...done.
smoke...done.
carbon...done.
twilight...done.
sand...done.
lake...done.
pebble...done.
oasis...done.
Finished installing webclient skins.
Setting zimbraFeatureTasksEnabled=TRUE...done.
Setting zimbraFeatureBriefcasesEnabled=TRUE...done.
Setting MTA auth host...done.
Setting TimeZone Preference...done.
Initializing mta config...done.
Setting services on mail.ps-ef.net...done.
Creating domain ps-ef.net...done.
Setting default domain name...done.
Creating domain ps-ef.net...already exists.
Creating admin account admin@ps-ef.net...done.
Creating root alias...done.
Creating postmaster alias...done.
Creating user spam.dclvwzqamo@ps-ef.net...done.
Creating user ham.90vqf3iex@ps-ef.net...done.
Creating user virus-quarantine.ca7ovwmko@ps-ef.net...done.
Setting spam training and Anti-virus quarantine accounts...done.
Initializing store sql database...done.
Setting zimbraSmtpHostname for mail.ps-ef.net...done.
Configuring SNMP...done.
Checking for default IM conference room...not present.
Initializing default IM conference room...done.
Setting up syslog.conf...done.

You have the option of notifying Zimbra of your installation.
This helps us to track the uptake of the Zimbra Collaboration Suite.
The only information that will be transmitted is:
The VERSION of zcs installed (7.1.0_GA_3140_CentOS5)
The ADMIN EMAIL ADDRESS created (admin@ps-ef.net)

짐브라 설치 과정 정보를 전송하지 않도록 한다. 해줘도 상관은 없다.

Notify Zimbra of your installation? [Yes] no

Notification complete

Starting servers...done.
Installing common zimlets...
com_zimbra_attachmail...done.
com_zimbra_webex...done.
com_zimbra_phone...done.
com_zimbra_dnd...done.
com_zimbra_cert_manager...done.
com_zimbra_date...done.
com_zimbra_srchhighlighter...done.
com_zimbra_url...done.
com_zimbra_adminversioncheck...done.
com_zimbra_linkedin...done.
com_zimbra_social...done.
com_zimbra_bulkprovision...done.
com_zimbra_attachcontacts...done.
com_zimbra_email...done.
Finished installing common zimlets.
Restarting mailboxd...done.
Setting up zimbra crontab...done.

Moving /tmp/zmsetup.02072014-182254.log to /opt/zimbra/log

Configuration complete - press return to exit

설치 완료 된 모습이다.

중간에 에러 메시지가 보이면.. 설치중 관련 프로그램 미설치나..hostname 부분. 등등

잘 살펴봐야된다. 아니면 삽질의 연속을..

Zimbra는 zimbra 계정으로 설치 및 실행된다.

zimbra 계정으로 전환한 후 zmcontrol status를 명령을 하여 구동중인지 확인해본다.

[root@mail zcs-7.1.0_GA_3140.RHEL5.20110329150824]# su - zimbra

[zimbra@mail ~]$ zmcontrol status

Host mail.ps-ef.net
antispam Running
antivirus Running
imapproxy Running
ldap Running
logger Running
mailbox Stopped
mysql.server is not running.
memcached Running
mta Running
snmp Running
spell Stopped
zmapachectl is not running
stats Stopped
zmconfigd Running
[zimbra@mail ~]$

에러 메시지가 나오는 현상을 볼수있을 것이다. 물론 에러 현상이 안보이고 성공한 사람들에게 박수를 보낸다.

에러부분을 잡아야되는데, 자세히 보니.. DB 가 올라가지 않는 현상때문에 그 밑에 spell 도 함께 에러가 발생된듯 싶다.

[zimbra@mail ~]$ exit
logout

[root@mail ~]# setenforce 0
[root@mail ~]# su - zimbra
[zimbra@mail ~]$ rm -rf /opt/zimbra/db/data/*

[zimbra@mail ~]$ /opt/zimbra/libexec/zmmyinit
* Creating required directories
* Generating mysql config /opt/zimbra/conf/my.cnf
* Creating database in /opt/zimbra/db/data
* Starting mysql server
* Loading schema /opt/zimbra/db/db.sql
* Loading version from /opt/zimbra/db/versions-init.sql
* Setting random passwd for mysql root user in zimbra localconfig
* Setting random passwd for mysql zimbra user in zimbra localconfig
* Changing mysql root user password
* Changing mysql zimbra user password
* Changed zimbra mysql user password

[zimbra@mail ~]$ zmcontrol start
Host mail.ps-ef.net
Starting ldap...Done.
Starting zmconfigd...Done.
Starting logger...Done.
Starting mailbox...Done.
Starting memcached...Done.
Starting imapproxy...Done.
Starting antispam...Done.
Starting antivirus...Done.
Starting snmp...Done.
Starting spell...Done.
Starting mta...Done.
Starting stats...Done.

[zimbra@mail ~]$ zmcontrol status
Host mail.ps-ef.net
antispam Running
antivirus Running
imapproxy Running
ldap Running
logger Running
mailbox Running
memcached Running
mta Running
snmp Running
spell Running
stats Running
zmconfigd Running

[zimbra@mail ~]$

성공이다.

/etc/init.d/iptables stop

iptables 을 중단하거나, zimbra 관련 해당 port 열어줘야지 정상적으로 사이트가 열린다.

http://mail.ps-ef.net

정상적으로 접근이 가능하면 성공!

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다