Howto zimbra: Difference between revisions

From Vidalinux Wiki
Jump to navigation Jump to search
Line 55: Line 55:
    
    
  DOMAIN=vidalinux.net
  DOMAIN=vidalinux.net
  CRTDIR=/root/certificates
  CERT_DIR=/root/certificates
  SSLDIR=/opt/zimbra/ssl/letsencrypt
  SSL_DIR=/opt/zimbra/ssl/letsencrypt
  CERT_KEY=$DOMAIN.key
  CERT_KEY=$DOMAIN.key
  CERT_CRT=$DOMAIN.crt
  CERT_CRT=$DOMAIN.crt
  CERT_ROOT=root.pem
  CERT_ROOT=root.pem
   
   
  if [ ! -d ${SSLDIR} ];
  if [ ! -d ${SSL_DIR} ];
  then
  then
  echo "creating ssl tmp directory"
  echo "creating ssl tmp directory"
  mkdir -p ${SSLDIR}
  mkdir -p ${SSL_DIR}
  fi
  fi
  echo "copying certificates to zimbra directory"
  echo "copying certificates to zimbra directory"
  rm -rf $SSLDIR/*
  rm -rf $SSL_DIR/*
  cp $CRTDIR/* $SSLDIR/
  cp $CERT_DIR/* $SSL_DIR/
  cp $CRTDIR/$CERT_KEY /opt/zimbra/ssl/zimbra/commercial/commercial.key
  cp $CERT_DIR/$CERT_KEY /opt/zimbra/ssl/zimbra/commercial/commercial.key
  chown -R zimbra.zimbra $SSLDIR/ /opt/zimbra/ssl/zimbra/commercial/commercial.key
  chown -R zimbra.zimbra $SSL_DIR/ /opt/zimbra/ssl/zimbra/commercial/commercial.key
  echo "verifying letsencrypt ssl certificates"
  echo "verifying letsencrypt ssl certificates"
  su - zimbra -c "/opt/zimbra/bin/zmcertmgr verifycrt comm $SSLDIR/$CERT_KEY $SSLDIR/$CERT_CRT $SSLDIR/$CERT_ROOT"
  su - zimbra -c "/opt/zimbra/bin/zmcertmgr verifycrt comm $SSL_DIR/$CERT_KEY $SSL_DIR/$CERT_CRT $SSL_DIR/$CERT_ROOT"
  echo "install letsencrypt ssl certificates"
  echo "install letsencrypt ssl certificates"
  su - zimbra -c "/opt/zimbra/bin/zmcertmgr deploycrt comm $SSLDIR/$CERT_CRT $SSLDIR/$CERT_ROOT"
  su - zimbra -c "/opt/zimbra/bin/zmcertmgr deploycrt comm $SSL_DIR/$CERT_CRT $SSL_DIR/$CERT_ROOT"
  echo "restarting zimbra services"
  echo "restarting zimbra services"
  /etc/init.d/zimbra restart
  /etc/init.d/zimbra restart

Revision as of 03:33, 14 April 2023

compile zimbra

install podman:

https://wiki.vidalinux.org/index.php/Howto_podman#install_podman_ubuntu

for ubuntu 18.04:

https://hub.docker.com/r/ovox/zimbrabuild-ubuntu18

for ubuntu 20.04:

https://hub.docker.com/r/ovox/zimbrabuild-ubuntu20

for centos7:

https://hub.docker.com/r/ovox/zimbrabuild-centos7

for almalinux8:

https://hub.docker.com/r/ovox/zimbrabuild-alma8

install zimbra

install the following packages for ubuntu :

apt-get update && apt-get -y install sqlite3 bind9-dnsutils perl perl-base perl-modules nano sudo libpcre3 libgmp10 unzip libgmp3-dev sysstat libexpat1 wget language-pack-en libaio1 pax dnsmasq

install the following packages rhel:

yum -y install wget nmap-ncat unzip perl-core openssh-clients sysstat net-tools ntpl sudo libidn libstdc++.so.6 gmp libaio dnsmasq       

set hostname:

hostnamectl set-hostname vidalinux.net

configure /etc/hosts:

127.0.0.1 localhost
192.168.24.45 vidalinux.net mail.vidalinux.net

configure domain:

cat >> /etc/dnsmasq.conf << EOF
listen-address=127.0.0.1
interface=eth0
expand-hosts
domain=vidalinux.net
server=4.2.2.1
server=4.2.2.2
address=/.vidalinux.net/127.0.0.1
address=/.vidalinux.net/192.168.24.45
EOF

make sure systemd-resolved is disable:

systemctl stop systemd-resolved.service
systemctl disable systemd-resolved.service

start and enable dnsmasq:

systemctl enable dnsmasq.service
systemctl start dnsmasq.service

configure /etc/resolv.conf:

nameserver 127.0.0.1

test your dns:

nslookup vidalinux.net

decompress zimbra archive:

cd ~/ubuntu20/volume/UBUNTU20_64-DAFFODIL-1000-20230413144723-FOSS-0001
tar xvf zcs-10.0.0_GA_0001.UBUNTU20_64.20230413144723.tgz
cd zcs-10.0.0_GA_0001.UBUNTU20_64.20230413144723

run zimbra installer:

./install.sh

access zimbra web interface:

https://vidalinux.net/

install ssl certificate

script for installing ssl certificate:

cat > /usr/local/bin/install-cert-zimbra << "EOF"
#!/bin/bash
 
DOMAIN=vidalinux.net
CERT_DIR=/root/certificates
SSL_DIR=/opt/zimbra/ssl/letsencrypt
CERT_KEY=$DOMAIN.key
CERT_CRT=$DOMAIN.crt
CERT_ROOT=root.pem

if [ ! -d ${SSL_DIR} ];
then
echo "creating ssl tmp directory"
mkdir -p ${SSL_DIR}
fi
echo "copying certificates to zimbra directory"
rm -rf $SSL_DIR/*
cp $CERT_DIR/* $SSL_DIR/
cp $CERT_DIR/$CERT_KEY /opt/zimbra/ssl/zimbra/commercial/commercial.key
chown -R zimbra.zimbra $SSL_DIR/ /opt/zimbra/ssl/zimbra/commercial/commercial.key
echo "verifying letsencrypt ssl certificates"
su - zimbra -c "/opt/zimbra/bin/zmcertmgr verifycrt comm $SSL_DIR/$CERT_KEY $SSL_DIR/$CERT_CRT $SSL_DIR/$CERT_ROOT"
echo "install letsencrypt ssl certificates"
su - zimbra -c "/opt/zimbra/bin/zmcertmgr deploycrt comm $SSL_DIR/$CERT_CRT $SSL_DIR/$CERT_ROOT"
echo "restarting zimbra services"
/etc/init.d/zimbra restart
EOF

references