zimbra on CentOS5 i386 + x64

By admin at 2017-09-29 • 0 collector • 1917 pageviews

1.ตั้งค่า DNS ของโดเมนให้ชื่อมาที่ ไอพี ที่เราจะติดตั้ง zimbra


สำหรับ ตั้งค่า DNS ที่ PARK ไว้ที่ godaddy.com  


สมมุตว่าตั้งชื่อ Host ที่เซอร์ฟเวอร์เมล์ zimbra 

- mail.thaiprogress.com


A(Host)

@ 108.60.150.146 (ชี่ไปที่เซอร์ฟเวอร์ที่ลง zimbra)

------------------------------------

CNAME(Alias)

calendar login.thaiprogress.com

email email.thaiprogress.com

fax login.thaiprogress.com

files login.thaiprogress.com

ftp @

imap @

mail @

mobilemail mobilemail-v01.prod.mesa1.secureserver.net

pop @

smtp @

www @

----------------------------------------

MX (Mail Exchanger)

10 @ mail.thaiprogress.com

0 @ smtp.thaiprogress.com

-----------------------------------------------


2.ติดตั้ง zimbra บน vps-server กับระบบปฏิบัติการ CentOS 5 64 bit


- การลง os บน centos จะติดตั้ง apache2 พร้อมกับระบบ sendmail มาด้วยต้องถอนออกก่อน

- # service httpd stop 

- # service sendmail stop

- # yum -y remove httpd        ถ้าไม่ถอนออก จะเข้าได้เฉพาะหน้าเวป Apache2 ของเดิมเท่านั้น

- # yum -y remove sendmail   ถ้าไม่ถอนออก MTA บน zimbra จะไม่ START

- # setenforce 0


3.ติดตั้ง และเตรียมระบบให้พร้อม

- # yum -y install nano ntp nmap sysstat nc gmp wget

- # yum -y update


###  หาก VPS มีแรมน้อยกว่า 1.5GB ให้ไปทำ swap ก่อนติดตั้ง zimbra  ######


----------------------------------------------x64-----------------------------------------------------------

4.ดาวน์โหลดและติดตั้ง zimbra 64 BIT

- # yum -y install perl libstdc++.i686


*** 7.2.0 GA Rekease ***

- # wget -c http://files2.zimbra.com/downloads/7.2.0_GA/zcs-7.2.0_GA_2669.RHEL5_64.20120410001942.tgz

- # tar xvfz zcs-7.2.0_GA_2669.RHEL5_64.20120410001942.tgz

- # cd zcs-7.2.0_GA_2669.RHEL5_64.20120410001942

- # ./install.sh --platform-override

----------------------


*** 7.2.2 GA Release ***

- # wget -c http://files2.zimbra.com/downloads/7.2.2_GA/zcs-7.2.2_GA_2852.RHEL5_64.20121204211814.tgz

- # tar xvfz 7.2.2_GA/zcs-7.2.2_GA_2852.RHEL5_64.20121204211814.tgz

- # cd 7.2.2_GA/zcs-7.2.2_GA_2852.RHEL5_64.20121204211814

- # ./install.sh --platform-override

-----------------------------------------------i386------------------------------------------------------------


4.1 ดาวน์โหลดและติดตั้ง zimbra 32 BIT


*** 7.2.0 GA Release ***

- # wget -c http://files2.zimbra.com/downloads/7.2.0_GA/zcs-7.2.0_GA_2669.RHEL5.20120410001957.tgz

- # tar xvfz zcs-7.2.0_GA_2669.RHEL5.20120410001957.tgz

- # ./install.sh --platform-override

---------------------------


*** 7.2.2 GA Release ***

- # wget -c http://files2.zimbra.com/downloads/7.2.2_GA/zcs-7.2.2_GA_2852.RHEL5.20121204211814.tgz

- # tar xvfz zcs-7.2.2_GA_2852.RHEL5.20121204211814.tgz

- # cd zcs-7.2.2_GA_2852.RHEL5.20121204211814

- # ./install.sh --platform-override

-----------------------------------------------------------------------------------------------------------


*** 7.2.7 GA Release ***

- # wget -c http://files2.zimbra.com/downloads/7.2.7_GA/zcs-7.2.7_GA_2942.RHEL5.20140314190034.tgz

- # tar xvfz zcs-7.2.7_GA_2942.RHEL5.20140314190034.tgz

- # cd zcs-7.2.7_GA_2942.RHEL5.20140314190034

- # ./install.sh --platform-override

-----------------------------------------------------------------------------------------------------------


ดูต่อด้านล่างเลย


ตัวอย่างการเซทอัพนำมาจากเวป


5. ตัว Zimbra จะทำการสอบถามข้อมูลสำหรับการติดตั้ง ซึ่งส่วนใหญ่ให้เลือกเป็น Yes (แล้วแต่ความเหมาะสมกับการใช้งานนะครับ)


    Operations logged to /tmp/install.log.2223

    Checking for existing installation…

    zimbra-ldap…NOT FOUND

    zimbra-logger…NOT FOUND

    zimbra-mta…NOT FOUND

    zimbra-snmp…NOT FOUND

    zimbra-store…NOT FOUND

    zimbra-apache…NOT FOUND

    zimbra-spell…NOT FOUND

    zimbra-convertd…NOT FOUND

    zimbra-memcached…NOT FOUND

    zimbra-proxy…NOT FOUND

    zimbra-archiving…NOT FOUND

    zimbra-cluster…NOT FOUND

    zimbra-core…NOT FOUND


    PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THE SOFTWARE.

    ZIMBRA, INC. (“ZIMBRA”) WILL ONLY LICENSE THIS SOFTWARE TO YOU IF YOU

    FIRST ACCEPT THE TERMS OF THIS AGREEMENT. BY DOWNLOADING OR INSTALLING

    THE SOFTWARE, OR USING THE PRODUCT, YOU ARE CONSENTING TO BE BOUND BY

    THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS

    AGREEMENT, THEN DO NOT DOWNLOAD, INSTALL OR USE THE PRODUCT.


    License Terms for the Zimbra Collaboration Suite:


    http://www.zimbra.com/license/zimbra_public_eula_2.1.html


    Do you agree with the terms of the software license agreement? [N] y


    Checking for prerequisites…

    FOUND: NPTL

    FOUND: sudo-1.7.2p1-9

    FOUND: libidn-0.6.5-1.1

    FOUND: gmp-4.1.4-10

    FOUND: /usr/lib64/libstdc++.so.6

    Checking for suggested prerequisites…

    FOUND: perl-5.8.8

    MISSING: sysstat does not appear to be installed.

    FOUND: sqlite


    ###WARNING###


    The suggested version of one or more packages is not installed.

    This could cause problems with the operation of Zimbra.


    Do you wish to continue? [N] y

    Prerequisite check complete.


    Checking for installable packages


    Found zimbra-core

    Found zimbra-ldap

    Found zimbra-logger

    Found zimbra-mta

    Found zimbra-snmp

    Found zimbra-store

    Found zimbra-apache

    Found zimbra-spell

    Found zimbra-memcached

    Found zimbra-proxy


    Select the packages to install


    Install zimbra-ldap [Y] y


    Install zimbra-logger [Y] y


    Install zimbra-mta [Y] y


    Install zimbra-snmp [Y] y


    Install zimbra-store [Y] y


    Install zimbra-apache [Y] y  


    Install zimbra-spell [Y] y     


    Install zimbra-memcached [N] y  ถ้าแรมน้อยให้ตอบ no


    Install zimbra-proxy [N] y            ถ้าแรมน้อยให้ตอบ no

    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

    zimbra-proxy


    You appear to be installing packages on a platform different

    than the platform for which they were built.


    This platform is CentOS5_64

    Packages found: RHEL5_64

    This may or may not work.


    Using packages for a platform in which they were not designed for

    may result in an installation that is NOT usable. Your support

    options may be limited if you choose to continue.


    Install anyway? [N] y


    The system will be modified.  Continue? [N] y


    Removing /opt/zimbra

    Removing zimbra crontab entry…done.

    done.

    Cleaning up zimbra init scripts…done.

    Cleaning up /etc/ld.so.conf…done.

    Cleaning up /etc/prelink.conf…done.

    Cleaning up /etc/security/limits.conf…done.


    Finished removing Zimbra Collaboration Suite.


    Installing packages


    zimbra-core……zimbra-core-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…done

    zimbra-ldap……zimbra-ldap-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…done

    zimbra-logger……zimbra-logger-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…done

    zimbra-mta……zimbra-mta-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…done

    zimbra-snmp……zimbra-snmp-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…done

    zimbra-store……zimbra-store-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…done

    zimbra-apache……zimbra-apache-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…done

    zimbra-spell……zimbra-spell-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…done

    zimbra-memcached……zimbra-memcached-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…done

    zimbra-proxy……zimbra-proxy-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…done

    Operations logged to /tmp/zmsetup.02142011-111650.log

    Installing LDAP configuration database…done.

    Setting defaults…     MX: mx.fakemx.net (46.4.35.23)


    Interface: 10.0.1.211

    Interface: 127.0.0.1

    46.4.35.23

    46.4.35.23


    DNS ERROR – none of the MX records for mail.thaiprogress.com

    resolve to this host

    Change domain name? [Yes] n <– กรณีที่ต้องการเปลี่ยนชื่อโดเม็นเช่น @test.com

    done.

    Checking for port conflicts

    Port conflict detected: 25 (zimbra-mta)

    Port conflicts detected! – Any key to continue


    Main menu


    1) Common Configuration:

    2) zimbra-ldap:                             Enabled

    3) zimbra-store:                            Enabled

    +Create Admin User:                    yes

    +Admin user to create:                 admin@mail.thaiprogress.com

    ******* +Admin Password                        UNSET

    +Anti-virus quarantine user:           virus-quarantine.dhd8naot@mail.thaiprogress.com

    +Enable automated spam training:       yes

    +Spam training user:                   spam.jjt0i43dxw@mail.thaiprogress.com

    +Non-spam(Ham) training user:          ham.zfdo_wqgzg@mail.thaiprogress.com

    +SMTP host:                            mail.thaiprogress.com

    +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.thaiprogress.com:7780/aspell.php

    +Enable version update checks:         TRUE

    +Enable version update notifications:  TRUE

    +Version update notification email:    admin@mail.thaiprogress.com

    +Version update source email:          admin@mail.thaiprogress.com


    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    ให้กดหมายเลขด้านหน้า ตามที่ต้องการ ตอนนี้ต้องการเปลี่ยนพาสเวิร์ดให้กดเลข 3


    Store configuration


    1) Status:                                  Enabled

    2) Create Admin User:                       yes

    3) Admin user to create:                    admin@mail.thaiprogress.com

    ** 4) Admin Password                           UNSET

    5) Anti-virus quarantine user:              virus-quarantine.dhd8naot@mail.thaiprogress.com

    6) Enable automated spam training:          yes

    7) Spam training user:                      spam.jjt0i43dxw@mail.thaiprogress.com

    8) Non-spam(Ham) training user:             ham.zfdo_wqgzg@mail.thaiprogress.com

    9) SMTP host:                               mail.thaiprogress.com

    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.thaiprogress.com:7780/aspell.php

    19) Enable version update checks:            TRUE

    20) Enable version update notifications:     TRUE

    21) Version update notification email:       admin@mail.thaiprogress.com

    22) Version update source email:             admin@mail.thaiprogress.com


    Select, or ‘r’ for previous menu [r] 4  กดหมายเลข 4 เพื่อเปลี่ยนรหัสผ่าน


    Password for admin@mail.thaiprogress.com (min 6 characters): [dKt1QlWQf] zaqwsx      ใส่รหัสผ่านที่ต้องการใช้งาน


    Store configuration


    1) Status:                                  Enabled

    2) Create Admin User:                       yes

    3) Admin user to create:                    admin@mail.thaiprogress.com

    4) Admin Password                           set

    5) Anti-virus quarantine user:              virus-quarantine.dhd8naot@mail.thaiprogress.com

    6) Enable automated spam training:          yes

    7) Spam training user:                      spam.jjt0i43dxw@mail.thaiprogress.com

    8) Non-spam(Ham) training user:             ham.zfdo_wqgzg@mail.thaiprogress.com

    9) SMTP host:                               mail.thaiprogress.com

    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.thaiprogress.com:7780/aspell.php

    19) Enable version update checks:            TRUE

    20) Enable version update notifications:     TRUE

    21) Version update notification email:       admin@mail.thaiprogress.com

    22) Version update source email:             admin@mail.thaiprogress.com


    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    กด a เพื่อนำค่าที่ตั้งไว้ไปใช้งาน

    Save configuration data to a file? [Yes]

    Save config in file: [/opt/zimbra/config.10246]

    Saving config in /opt/zimbra/config.10246…done.

    The system will be modified – continue? [No] yes

    Operations logged to /tmp/zmsetup.02142011-111650.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.thaiprogress.com…done.

    Saving CA in ldap …done.

    Saving SSL Certificate in ldap …done.

    Setting spell check URL…done.

    Setting service ports on mail.thaiprogress.com…done.

    Adding mail.thaiprogress.com to zimbraMailHostPool in default COS…done.

    Installing webclient skins…

    twilight…done.

    bones…done.

    lavender…done.

    tree…done.

    steel…done.

    pebble…done.

    oasis…done.

    lake…done.

    carbon…done.

    smoke…done.

    beach…done.

    lemongrass…done.

    hotrod…done.

    sand…done.

    waves…done.

    sky…done.

    bare…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.thaiprogress.com…done.

    Creating domain mail.thaiprogress.com…done.

    Setting default domain name…done.

    Creating domain mail.thaiprogress.com…already exists.

    Creating admin account admin@mail.thaiprogress.com…done.

    Creating root alias…done.

    Creating postmaster alias…done.

    Creating user spam.jjt0i43dxw@mail.thaiprogress.com…done.

    Creating user ham.zfdo_wqgzg@mail.thaiprogress.com…done.

    Creating user virus-quarantine.dhd8naot@mail.thaiprogress.com…done.

    Setting spam training and Anti-virus quarantine accounts…done.

    Initializing store sql database…done.

    Setting zimbraSmtpHostname for mail.thaiprogress.com…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.0.0_GA_3077_CentOS5_64)

    The ADMIN EMAIL ADDRESS created (admin@mail.thaiprogress.com)


    Notify Zimbra of your installation? [Yes] no กด no เพื่อไม่ให้ส่งข้อมูลไปยังผู้พัฒนา

    Notification skipped

    Starting servers…done.

    Installing common zimlets…

    com_zimbra_attachcontacts…done.

    com_zimbra_bulkprovision…done.

    com_zimbra_url…done.

    com_zimbra_linkedin…done.

    com_zimbra_srchhighlighter…done.

    com_zimbra_adminversioncheck…done.

    com_zimbra_attachmail…done.

    com_zimbra_cert_manager…done.

    com_zimbra_email…done.

    com_zimbra_webex…done.

    com_zimbra_social…done.

    com_zimbra_dnd…done.

    com_zimbra_phone…done.

    com_zimbra_date…done.

    Finished installing common zimlets.

    Restarting mailboxd…done.

    Setting up zimbra crontab…done.


    Moving /tmp/zmsetup.02142011-111650.log to /opt/zimbra/log


    Configuration complete – press return to exit


    [root@mail zcs-7.0.0_GA_3077.RHEL5_64.20110127201852]#


6. ลองเปิดเว็บเบราเซอร์เพื่อเข้าใช้งาน โดยพิมพ์ที่่ Address bar ให้เป็นไอพีแอดเดรสของ server หรือจะพิมพ์เป็นชื่อก็ได้ หากได้ทำการตั้งค่า dns ไว้ก่อนแล้ว


    http://mail.thaiprogress.com         สำหรับสมาชิกใช้งานทั่วไป (admin ถ้า login ตรงนี้ก็ถือว่าเป็นผู้ใช้งานทั่วไปนะครับ)


    https://mail.thaiprogress.com:7071    สำหรับผู้ดูแลระบบ ในส่วนนี้ จะสามารถแก้ไขปรับแต่งค่าได้ตามใจชอบเลยครับ


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



การคอนฟิคให้กินทรัพยากรน้อยที่สุด


Zimbra OCS on a OpenVZ VPS Server


I recently went and brought a VPS from burst.net  Basic specs are 2x 2500Mhz CPU cores, 2.5gb guaranteed memory (no burstable).


This should be more then enough I though to run Zimbra OCS after all I have it up and running in a Test VM running on ESXi with only 1gb of memory and 1 cpu core.


What I did not release is that when a Java server process starts up, you can define how much memory it grabs and what size of memory chunks it asks for. Out of the box install of Zimbra optimise’s it self for the total amount of system memory in my case 2.5gb. So when the ZImbra  application stack goes to start on my OpenVZ VPS it comes up with an fail ” Can not create Java Virtual machine, out of memory”


Out of memory wtf!

The Java stack expects to be able to grab a contiguous chunk of memory, in my case 1.5gb. Because of the underlying OpenVZ and the way it handles memory its not possible for a OpenVZ VPS instance to have a contiguous block of memory.

Hence why the JVM was crashing, Originally it was asking for 3x 512mb blocks of contiguous memory.

My VPS could not do this, you could edit the OpenVZ settings to allow bigger “chunks” of memory to be offered up. Since I have no control over this I had to tell Java to ask for more lots of smaller chunks of memory.


If your trying to get around the errors. Do the following.

Commands to type are in italics


1) Install Zimbra but do not start any of the services and or application stack after configuration.


2) Change to the zimbra user and  enter the following commands.

# su – zimbra

# zmlocalconfig -e mailboxd_java_options=”-server -Djava.awt.headless=true -XX:+UseConcMarkSweepGC -XX:NewRatio=2 -XX:PermSize=128m \

-XX:MaxPermSize=128m -XX:SoftRefLRUPolicyMSPerMB=1 -Xms128m -Xmx128m”

# zmlocalconfig -e tomcat_java_heap_memory_percent=5

# zmlocalconfig -e zmmtaconfig_interval=3600

# zmlocalconfig -e zmstat_interval=300

# zmlocalconfig -e mailboxd_java_heap_memory_percent=5

# zmlocalconfig -e mailboxd_java_heap_new_size_percent=5

# zmlocalconfig -e ldap_common_threads=16

# zmlocalconfig -e ldap_common_toolthreads=8

# zmlocalconfig -e ldap_db_cachesize=50000

# zmlocalconfig -e ldap_db_idlcachesize=50000

# zmlocalconfig -e ldap_db_dncachesize=0

# zmlocalconfig -e zimbra_zmjava_options=”-Xms128m -Xmx128m”

# zmprov mcf zimbraMessageCacheSize 5000


3)

Now we need to tune some of the non Zimbra apps, Change back to the root user for this.

Edit the following files

# nano /opt/zimbra/conf/amavisd.conf.in

Edit the folowing

“$max_servers =10? and set it to “$max_servers =2?


# nano /opt/zimbra/conf/my.cnf

Edit/add the following

“innodb_buffer_pool_size =” to “innodb_buffer_pool_size = 144245094?

“thread_cache = ” to “thread_cache = 5?

“max_connections   = ” to “max_connections   = 15?


I’ve now got Zimbra OCS up and running in a VPS. So far its been very stable and preforms quite fine for my work load.


References for the above :-

http://wiki.zimbra.com/index.php?title=Making_Zimbra_run_on_minimal_RAM

http://wiki.zimbra.com/wiki/CLI_zmlocalconfig_%28Local_Configuration%29

http://www.zimbra.com/docs/ne/latest/administration_guide/zmlocalconfig.html

http://docs.sun.com/source/817-2180-10/pt_chap5.html


-----------------

การคอนฟิคให้เมล์ทุกฉบับเข้ามาในเซอร์ฟให้ cc ไปถึงผู้ทีกำหนดไว้ แก้ค่าโดย


# nano /opt/zinbra/postfix/conf/main.cf


เพิ่มคำสั่งต่อท้ายในไฟล์ ดังตัวอย่าง


always_bcc = user@domain.com


-------------------------------------------------------------


CLI - To DISABLE AV/AS

su - zimbra

zmprov ms ciothai.com -zimbraServiceEnabled antivirus

zmprov ms ciothai.com -zimbraServiceEnabled antispam

zmcontrol stop

zmcontrol start

zmcontrol status

CLI - To ENABLE AV/AS

su - zimbra

zmprov ms ciothai.com +zimbraServiceEnabled antivirus

zmprov ms ciothai.com +zimbraServiceEnabled antispam

zmcontrol stop

zmcontrol start

zmcontrol status





เซฟ แล้วรีสตาร์ท zimbra ใหม่


Requires Login

Loading...