CentOS 7.x Install Zimbra on AWS lightsail instance
<yambe:breadcrumb self="Install Zimbra on AWS lightsail instance">CentOS_7.x_Install_Zimbra|Install Zimbra</yambe:breadcrumb> <yambe:breadcrumb self="Install Zimbra on AWS lightsail instance">CentOS_7.x_Setup_lightsail_instances|Setup lightsail instances</yambe:breadcrumb>
CentOS 7.x Install Zimbra on AWS lightsail instance
To Install Zimbra (Eg 8.8.11) on AWS lightsail instance use:
- Create appropriate lightsail instance with possibly 8GB or more RAM
- For production instances create static IP and attach with instance
- Create DNS entry for FQDN mapping to static IP. *Ensure that appropriate MX records for mail domains are also configured.*
- Allow access to server in lightsail instance networking firewall section for following ports: 22, 25, 80, 110, 443, 465, 587, 993 and 7071
- Note that POP related ports are intentionally omitted. Also note that 110, 25, etc. are required for TLS
- Download corresponding regions private key
- chmod 400 <private-key>
- ssh -i <private-key> centos@<instance-public-ip>
- sudo su -
- Disable SELinux
- yum -y install vim wget epel-release firewalld
- vim ~/.ssh/authorized_keys
- Add own key, Allow <private-key> direct root aaccess. (First line 155x)
- Set hostname
- hostname <desired-fqdn>
- vim /etc/hostname
- Exit
- ssh directly as root with self public key
- wget Zimbra 8.8.11 or desired version setup from Zimbra website to /root folder
- Validate no process is listening on port 25
- ss -alnp | grep 25
-
- if there is sendmail or postfix, stop and disable corresponding service
- systemctl stop postfix
- systemctl disable postfix
- if there is sendmail or postfix, stop and disable corresponding service
- Create appropriate swap space using CentOS 7.x adding swap space using file
- Setup fail2ban using CentOS 7.x fail2ban including firewalld using CentOS 7.x Basic firewalld configuration
- Create firewalld exception for ports same as lightsail instance networking exceptions
- Have /etc/hosts similar to:
- 127.0.0.1 localhost.localdomain localhost
- 172.26.15.186 mail.zimbra.sbarjatiya.com
-
- where 172.26.15.186 is the lightsail private IP of the Zimbra instance.
- Install dependencies
- yum -y install perl perl-core ntp nmap sudo libidn gmp libaio libstdc++ unzip sysstat sqlite epel-release
- yum -y install less bind-utils htop logwatch
- If installation would be repeated often and caching is desired edit /etc/yum.conf and set keepcache=1
- Set correct time zone CentOS 7.x Change system timezone
- Configure system to store history date time using Storing date / time along with commands in history
- exit or possibly reboot and ssh again for history settings to take effect. In case of reboot note that lightsail firewall might block ICMP communication so ping as method of checking if server is up again, wont work.
- Install zimbra by extracting .tgz file and running ./install.sh
- EULA: Y
- Use Zimbra package repository: Y
- For most packages leave to default Y.
- On system would be modified caution: Y
- Typically hostname of zimbra server is mail.zimbra.sbarjatiya.com while the server is supposed to act as email server for domain zimbra.sbarjatiya.com. In such cases use something similar to:
- DNS ERROR resolving MX for mail.zimbra.sbarjatiya.com
- It is suggested that the domain name have an MX record configured in DNS
- Change domain name? [Yes] Yes
- Create domain: [mail.zimbra.sbarjatiya.com] zimbra.sbarjatiya.com
- DNS ERROR - none of the MX records for zimbra.sbarjatiya.com
- resolve to this host
- It is suggested that the MX record resolve to this host
- Re-Enter domain name? [Yes] No
- Set admin password and rest all can be left as it is (7, 4)
- Use 'r' to return to main menu and 'a' for applying configuration
- Further use responses similar to:
- Save configuration data to a file? [Yes]
- Save config in file: [/opt/zimbra/config.7626]
- Saving config in /opt/zimbra/config.7626...done.
- The system will be modified - continue? [No] Yes
-
- Now setup should take really long time for various installations and configurations
- Enter 'No' for notify Zimbra of installation for test machines. In case of production machines you can optionally enter 'Yes'.
- Press return to exit on 'Press return to exit' message :)
- Check status of Zimbra services which take a few minutes to start
- su - zimbra
- zmcontrol status
- Access admin panel via browser at https://mail.zimbra.sbarjatiya.com:7071
- Use CentOS 7.x Configuring dnsmasq for Zimbra behind NAT to resolve email not delivered to self domains issue
- Send a few test email to external domains such as gmail and also try to receive emails from external domains.
Retrying installation
In case installation fails mid-way then remove by referring Zimbra uninstallation and try again after resolving issue which caused the previous installation to fail.
<yambe:breadcrumb self="Install Zimbra on AWS lightsail instance">CentOS_7.x_Install_Zimbra|Install Zimbra</yambe:breadcrumb> <yambe:breadcrumb self="Install Zimbra on AWS lightsail instance">CentOS_7.x_Setup_lightsail_instances|Setup lightsail instances</yambe:breadcrumb>