Difference between revisions of "Building Zimbra on Gentoo"

(Installing Zimbra on Gentoo using the provided Debian package)
(Installing Zimbra on Gentoo using the provided Debian package)
Line 26: Line 26:
 
# Create the init.d script (/etc/init.d/zimbra)
 
# Create the init.d script (/etc/init.d/zimbra)
 
# Start the zimbra suite: /etc/init.d/zimbra start
 
# Start the zimbra suite: /etc/init.d/zimbra start
 +
 +
== init.d script ==
 +
<pre>
 +
#!/sbin/runscript
 +
 +
depend() {
 +
    need net
 +
    after portmap
 +
    after iptables
 +
    after dnsmasq
 +
}
 +
 +
start() {
 +
 +
chroot="/Zimbra"
 +
bind_directories="proc dev dev/pts dev/shm sys"
 +
 +
for directory in $bind_directories ; do
 +
mount --bind /$directory $chroot/$directory
 +
done
 +
 +
echo "rm -rf /var/run/*.pid" | chroot $chroot
 +
echo "/etc/init.d/cron start" | chroot $chroot
 +
echo "/etc/init.d/sysklogd start" | chroot $chroot
 +
echo 'su - zimbra -c "/opt/zimbra/bin/zmcontrol start"' | chroot $chroot
 +
 +
}
 +
 +
stop() {
 +
 +
chroot="/Zimbra"
 +
 +
echo 'su - zimbra -c "/opt/zimbra/bin/zmcontrol stop"' | chroot $chroot
 +
echo "/etc/init.d/cron stop" | chroot $chroot
 +
echo "/etc/init.d/sysklogd stop" | chroot $chroot
 +
 +
bind_directories="proc dev/pts dev/shm dev sys"
 +
 +
for directory in $bind_directories ; do
 +
  umount $chroot/$directory
 +
done
 +
}
 +
</pre>
  
 
Your debian environment needs less than 200 MB (without zimbra) which isn’t too much overhead.
 
Your debian environment needs less than 200 MB (without zimbra) which isn’t too much overhead.

Revision as of 23:01, 12 December 2006

Installing Zimbra on Gentoo using the provided Debian package

(Taken from http://www.elfenbeinturm.cc/2006/07/28/zimbra-on-gentoo/)

  1. add ~x86 for dev-util/debootstrap to your /etc/portage/package.keywords
  2. emerge debootstrap
  3. create the chroot environment: mkdir /zimbra
  4. run debootstrap: debootstrap sarge /zimbra http://ftp.debian.org/debian
  5. mount proc, dev and sys
    • mount -o bind /proc /zimbra/proc
    • mount -o bind /sys /zimbra/sys
    • mount -o bind /dev /zimbra/dev
    • mount -o bind /dev/pts /zimbra/dev/pts
    • mount -o bind /dev/shm /zimbra/dev/shm
  6. chroot to the debian environment: chroot /zimbra
  7. Set a root password
  8. Adjust your /etc/hosts and /etc/hostname
  9. Edit your /etc/apt/apt.conf and add: APT::Cache-Limit 16777216;
  10. Add testing and unstable repositories to /etc/apt/sources.list [NOTE: it was suggested that this step is harmful; do at your own risk]:
  11. Update the package listing: apt-get update
  12. Update the system: apt-get upgrade
  13. Install required packages:
    • apt-get install sudo libidn11 curl fetchmail libgmp3 libxml2 libstdc++6 openssl file perl libexpat1
  14. Get the zimbra debian package and untar the archive
  15. Run ./install.sh in the newly created zcs directory and follow the instructions
  16. Create the init.d script (/etc/init.d/zimbra)
  17. Start the zimbra suite: /etc/init.d/zimbra start

init.d script

#!/sbin/runscript

depend() {
    need net
    after portmap
    after iptables
    after dnsmasq
}

start() {

chroot="/Zimbra"
bind_directories="proc dev dev/pts dev/shm sys"

for directory in $bind_directories ; do
 mount --bind /$directory $chroot/$directory
done

echo "rm -rf /var/run/*.pid" | chroot $chroot
echo "/etc/init.d/cron start" | chroot $chroot
echo "/etc/init.d/sysklogd start" | chroot $chroot
echo 'su - zimbra -c "/opt/zimbra/bin/zmcontrol start"' | chroot $chroot

}

stop() {

chroot="/Zimbra"

echo 'su - zimbra -c "/opt/zimbra/bin/zmcontrol stop"' | chroot $chroot
echo "/etc/init.d/cron stop" | chroot $chroot
echo "/etc/init.d/sysklogd stop" | chroot $chroot

bind_directories="proc dev/pts dev/shm dev sys"

for directory in $bind_directories ; do
  umount $chroot/$directory
done
} 

Your debian environment needs less than 200 MB (without zimbra) which isn’t too much overhead.

Building Zimbra from source on Gentoo

(needs to be documented)

Jump to: navigation, search