Difference between revisions of "Zimbra install"
Jump to navigation
Jump to search
(Created page with "https://inguide.in/install-zimbra-on-ubuntu-20-04-step-by-step/") |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
https://inguide.in/install-zimbra-on-ubuntu-20-04-step-by-step/ | https://inguide.in/install-zimbra-on-ubuntu-20-04-step-by-step/ | ||
+ | |||
+ | .env | ||
+ | ``` | ||
+ | #!/bin/bash | ||
+ | set -a | ||
+ | MYIP=$(hostname -I | cut -f1 -d" " | tr -d '[:space:]') | ||
+ | DOMAIN="example.com" | ||
+ | HOSTONLY="zmail" | ||
+ | HOSTNAME="${HOSTONLY}"."$DOMAIN" | ||
+ | TIMEZONE="America/Denver" | ||
+ | LETSENCRYPT=n | ||
+ | APACHE=y | ||
+ | MYPASSWORD=$(openssl rand -base64 9) | ||
+ | GREEN='\033[0;32m' | ||
+ | RED='\033[0;31m' | ||
+ | NC='\033[0m' # No Color | ||
+ | SYSTEMMEMORY=$(($(grep MemAvailable /proc/meminfo | awk '{print $2}')/1024/1024)) | ||
+ | ``` | ||
+ | |||
+ | ``` | ||
+ | #!/bin/bash | ||
+ | set -eu | ||
+ | |||
+ | host_prep(){ | ||
+ | echo "Rewriting the /etc/hosts file ..." | ||
+ | mv /etc/hosts /etc/hosts.old | ||
+ | printf '127.0.0.1\tlocalhost.localdomain\tlocalhost\n127.0.1.1\tubuntu\n'$MYIP'\t'$HOSTNAME'\t'$HOSTONLY'\t' | tee -a /etc/hosts >/dev/null 2>&1 | ||
+ | echo -e "${GREEN}... Done.${NC}" | ||
+ | echo "Setting hostname ($HOSTNAME) and timezone ($TIMEZONE) ..." | ||
+ | hostnamectl set-hostname $HOSTNAME >/dev/null 2>&1 | ||
+ | timedatectl set-timezone $TIMEZONE >/dev/null 2>&1 | ||
+ | echo -e "${GREEN}... Done.${NC}" | ||
+ | } | ||
+ | |||
+ | |||
+ | use_google_dns(){ | ||
+ | systemctl stop systemd-resolved | ||
+ | systemctl disable systemd-resolved | ||
+ | systemctl mask systemd-resolved | ||
+ | |||
+ | mv /etc/resolv.conf {,.old} | ||
+ | echo "nameserver 8.8.8.8" > /etc/resolv.conf | ||
+ | } | ||
+ | |||
+ | dnsmasq(){ | ||
+ | #DEBIAN_FRONTEND=noninteractive apt-get install -qq -y dnsmasq lsb-release net-tools netfilter-persistent dnsutils iptables sed wget rsyslog ldapscripts< /dev/null > /dev/null | ||
+ | # DEBIAN_FRONTEND=noninteractive apt-get install -qq -y dnsmasq lsb-release net-tools netfilter-persistent dnsutils iptables sed wget rsyslog ldapscripts< /dev/null > /dev/null | ||
+ | DEBIAN_FRONTEND=noninteractive apt-get install -qq -y dnsmasq dnsutils | ||
+ | #Install a DNS Server | ||
+ | echo "Configuring dnsmasq ..." | ||
+ | mv /etc/dnsmasq.conf /etc/dnsmasq.conf.old | ||
+ | #create the conf file | ||
+ | # printf 'server=8.8.8.8\nserver=8.8.4.4\nserver=9.9.9.9\nserver=149.112.112.112\nserver=1.1.1.1\nserver=1.0.0.1\nlisten-address=127.0.0.1\ndomain='$DOMAIN'\nmx-host='$DOMAIN','$HOSTNAME',0\naddress=/'$HOSTNAME'/'$MYIP'\n' | tee -a /etc/dnsmasq.conf >/dev/null | ||
+ | printf 'listen-address=127.0.0.1\ndomain='$DOMAIN'\nmx-host='$DOMAIN','$HOSTNAME',0\naddress=/'$HOSTNAME'/'$MYIP'\n' | tee -a /etc/dnsmasq.conf >/dev/null | ||
+ | mv /etc/resolv.conf {,.old} | ||
+ | echo "nameserver 127.0.0.1" > /etc/resolv.conf | ||
+ | # restart dns services | ||
+ | systemctl enable dnsmasq.service > /dev/null 2>&1 && systemctl restart dnsmasq.service | ||
+ | echo -e "${GREEN}... Done.${NC}" | ||
+ | |||
+ | # Check DNS | ||
+ | echo "Checking DNS ..." | ||
+ | name=`host google.com` | ||
+ | if [[ "$name" == *"not found"* ]]; then | ||
+ | echo -e "${RED}DNS resolution failed! Check your resolve.conf file.${NC}" | ||
+ | exit 1 | ||
+ | else | ||
+ | echo -e "${GREEN}... Done.${NC}" | ||
+ | fi | ||
+ | } | ||
+ | host_prep | ||
+ | # use_google_dns | ||
+ | dnsmasq | ||
+ | |||
+ | curl -LO https://download.zextras.com/zcs-9.0.0_OSE_UBUNTU20_latest-zextras.tgz | ||
+ | tar xf zcs-9.0.0_OSE_UBUNTU20_latest-zextras.tgz | ||
+ | |||
+ | dir=$(ls | grep zcs-9.0.0_ZEXTRAS) | ||
+ | cd $dir | ||
+ | ./install.sh | ||
+ | # disable zimbra dnscache | ||
+ | zmcontrol status | ||
+ | zmprov gs `zmhostname` zimbraServiceEnabled zimbraServiceInstalled | ||
+ | zmprov ms `zmhostname` -zimbraServiceEnabled dnscache -zimbraServiceInstalled dnscache | ||
+ | ``` | ||
+ | |||
+ | 22MB & 146MB | ||
+ | ``` | ||
+ | zmprov modifyConfig zimbraMtaMaxMessageSize 30720000 | ||
+ | zmprov modifyConfig zimbraFileUploadMaxSize 204800000 | ||
+ | ``` | ||
+ | |||
+ | ``` | ||
+ | zmzimletctl listZimlets | ||
+ | zmzimletctl disable com_zextras_drive_open | ||
+ | zmcontrol restart | ||
+ | ``` | ||
+ | |||
+ | # Update public url hostname for briefcase and other tools. If not it will use the server hostname defined on install. | ||
+ | |||
+ | https://wiki.zimbra.com/wiki/Steps_to_fix_port_redirection_problem_with_password_change_request_on_webclient | ||
+ | ``` | ||
+ | # zmprov md (md is domain level mcf is global) | ||
+ | zmprov mcf zimbraPublicServiceHostname mail.example.com | ||
+ | zmprov mcf zimbraPublicServiceProtocol https | ||
+ | zmprov mcf zimbraPublicServicePort 443 | ||
+ | zmcontrol restart | ||
+ | ``` | ||
+ | |||
+ | Admin proxy on 9071 for reverse proxy | ||
+ | ``` | ||
+ | /opt/zimbra/libexec/zmproxyconfig -e -w -C -H `zmhostname` | ||
+ | zmproxyctl restart | ||
+ | ``` |
Latest revision as of 02:59, 14 May 2023
https://inguide.in/install-zimbra-on-ubuntu-20-04-step-by-step/
.env
#!/bin/bash set -a MYIP=$(hostname -I | cut -f1 -d" " | tr -d '[:space:]') DOMAIN="example.com" HOSTONLY="zmail" HOSTNAME="${HOSTONLY}"."$DOMAIN" TIMEZONE="America/Denver" LETSENCRYPT=n APACHE=y MYPASSWORD=$(openssl rand -base64 9) GREEN='\033[0;32m' RED='\033[0;31m' NC='\033[0m' # No Color SYSTEMMEMORY=$(($(grep MemAvailable /proc/meminfo | awk '{print $2}')/1024/1024))
#!/bin/bash set -eu host_prep(){ echo "Rewriting the /etc/hosts file ..." mv /etc/hosts /etc/hosts.old printf '127.0.0.1\tlocalhost.localdomain\tlocalhost\n127.0.1.1\tubuntu\n'$MYIP'\t'$HOSTNAME'\t'$HOSTONLY'\t' | tee -a /etc/hosts >/dev/null 2>&1 echo -e "${GREEN}... Done.${NC}" echo "Setting hostname ($HOSTNAME) and timezone ($TIMEZONE) ..." hostnamectl set-hostname $HOSTNAME >/dev/null 2>&1 timedatectl set-timezone $TIMEZONE >/dev/null 2>&1 echo -e "${GREEN}... Done.${NC}" } use_google_dns(){ systemctl stop systemd-resolved systemctl disable systemd-resolved systemctl mask systemd-resolved mv /etc/resolv.conf {,.old} echo "nameserver 8.8.8.8" > /etc/resolv.conf } dnsmasq(){ #DEBIAN_FRONTEND=noninteractive apt-get install -qq -y dnsmasq lsb-release net-tools netfilter-persistent dnsutils iptables sed wget rsyslog ldapscripts< /dev/null > /dev/null # DEBIAN_FRONTEND=noninteractive apt-get install -qq -y dnsmasq lsb-release net-tools netfilter-persistent dnsutils iptables sed wget rsyslog ldapscripts< /dev/null > /dev/null DEBIAN_FRONTEND=noninteractive apt-get install -qq -y dnsmasq dnsutils #Install a DNS Server echo "Configuring dnsmasq ..." mv /etc/dnsmasq.conf /etc/dnsmasq.conf.old #create the conf file # printf 'server=8.8.8.8\nserver=8.8.4.4\nserver=9.9.9.9\nserver=149.112.112.112\nserver=1.1.1.1\nserver=1.0.0.1\nlisten-address=127.0.0.1\ndomain='$DOMAIN'\nmx-host='$DOMAIN','$HOSTNAME',0\naddress=/'$HOSTNAME'/'$MYIP'\n' | tee -a /etc/dnsmasq.conf >/dev/null printf 'listen-address=127.0.0.1\ndomain='$DOMAIN'\nmx-host='$DOMAIN','$HOSTNAME',0\naddress=/'$HOSTNAME'/'$MYIP'\n' | tee -a /etc/dnsmasq.conf >/dev/null mv /etc/resolv.conf {,.old} echo "nameserver 127.0.0.1" > /etc/resolv.conf # restart dns services systemctl enable dnsmasq.service > /dev/null 2>&1 && systemctl restart dnsmasq.service echo -e "${GREEN}... Done.${NC}" # Check DNS echo "Checking DNS ..." name=`host google.com` if [[ "$name" == *"not found"* ]]; then echo -e "${RED}DNS resolution failed! Check your resolve.conf file.${NC}" exit 1 else echo -e "${GREEN}... Done.${NC}" fi } host_prep # use_google_dns dnsmasq curl -LO https://download.zextras.com/zcs-9.0.0_OSE_UBUNTU20_latest-zextras.tgz tar xf zcs-9.0.0_OSE_UBUNTU20_latest-zextras.tgz dir=$(ls | grep zcs-9.0.0_ZEXTRAS) cd $dir ./install.sh # disable zimbra dnscache zmcontrol status zmprov gs `zmhostname` zimbraServiceEnabled zimbraServiceInstalled zmprov ms `zmhostname` -zimbraServiceEnabled dnscache -zimbraServiceInstalled dnscache
22MB & 146MB
zmprov modifyConfig zimbraMtaMaxMessageSize 30720000 zmprov modifyConfig zimbraFileUploadMaxSize 204800000
zmzimletctl listZimlets zmzimletctl disable com_zextras_drive_open zmcontrol restart
Update public url hostname for briefcase and other tools. If not it will use the server hostname defined on install.
# zmprov md (md is domain level mcf is global) zmprov mcf zimbraPublicServiceHostname mail.example.com zmprov mcf zimbraPublicServiceProtocol https zmprov mcf zimbraPublicServicePort 443 zmcontrol restart
Admin proxy on 9071 for reverse proxy
/opt/zimbra/libexec/zmproxyconfig -e -w -C -H `zmhostname` zmproxyctl restart