Fedora 22 on Jiffybox   July 10th, 2015

I am using Jiffybox for developing and testing. It easy to create a new virtual machine, and start from fresh again.

Unfortunately, Fedora 22 is not available yet. See for details: https://www.df.eu/forum/threads/76789-Update-auf-Fedora-22

For the moment, the only way is to upgrade your Jiffyboxes from Fedora 21 to Fedora 22. Fedup does not work, because of the kernel image.

IOError: [Errno 2] No such file or directory: '/boot/initramfs-3.18.9-x86_64-jb1.img'

The solution is to use yum distro-sync.

There is another problem with the firewalld package:

Fehler: Paket: firewalld-config-standard-0.3.14.2-2.fc21.noarch (@updates/21)
            Benötigt: firewalld = 0.3.14.2-2.fc21
            Entfernen: firewalld-0.3.14.2-2.fc21.noarch (@updates/21)
                firewalld = 0.3.14.2-2.fc21
            Aktualisiert durch: firewalld-0.3.14.2-2.fc22.noarch (updates)
                firewalld = 0.3.14.2-2.fc22
            Verfügbar: firewalld-0.3.13-7.fc22.noarch (fedora)
                firewalld = 0.3.13-7.fc22

So these are the commands that work for me:

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-$(uname -i)
yum update yum
yum clean all
# avoid problems with yum not being able to resolve firewalld upgrade
yum remove firewalld
yum --releasever=22 distro-sync
Tags: ,
Posted in Software Development | Comments Closed

This describes how to install a docker image of Kolab.

Please note: this is not meant to be for production use. The main purpose is to provide an easy way for demonstration of features and for product validation.

This installation has not been tested a lot, and could still use some fine tuning. This is just a demonstration of what could be done with Docker for Kolab.

Preparing for Docker
I am using a Jiffybox provided by DomainFactory for downloading a Docker container for Kolab 3.3 running on CentOS 6.

I have installed Ubuntu 12.04 LTS on a Jiffybox.
I am therefore following Docker Installation instructions for Ubuntu for the installation instructions:

Install a kernel that is required by Docker:

sudo apt-get update
sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring

After that, in the admin website of JiffyBox, select the custom kernel Bootmanager 64 Bit (pvgrub64); see also the german JiffyBox FAQ. Then restart your JiffyBox.

After the restart, uname -a should show something like:

Linux j89610.servers.jiffybox.net 3.8.0-37-generic #53~precise1-Ubuntu SMP Wed Feb 19 21:37:54 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Now install docker:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
 
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
 
sudo apt-get update
sudo apt-get install lxc-docker

Install container
The image for the container is available here:
https://index.docker.io/u/tpokorra/kolab33_centos6/
If you want to know how this image was created, read my other blog post http://www.pokorra.de/2014/09/building-a-docker-container-for-kolab-3-3-on-jiffybox/.

To install this image, you need to type in this command:

docker pull  tpokorra/kolab33_centos6

You can create a container from this image and run it:

MYAPP=$(sudo docker run --name centos6_kolab33 -P -h kolab33.test.example.org -d -t -i tpokorra/kolab33_centos6)

You can see all your containers:

docker ps -a

You now have to attach to the container, and inside the container start the services:

docker attach $MYAPP
  /root/start.sh

Somehow it should work to start the services automatically at startup, but I did not get it to work with CMD or ENTRYPOINT.

To stop the container, type exit on the container’s console, or run from outside:

docker stop $MYAPP

To delete the container:

docker rm $MYAPP

You can reach the Kolab Webadmin on this URL:
https://localhost/kolab-webadmin. Login with user: cn=Directory Manager, password: test

The Webmail interface is available here:
https://localhost/roundcubemail.

Tags: , ,
Posted in Software Development, Uncategorized | Comments Closed

This article is an update of the previous post that built a Docker container for Kolab 3.1: Building a Docker container for Kolab on Jiffybox (March 2014)

Preparation
I am using a Jiffybox provided by DomainFactory for building a Docker container for Kolab 3.3 running on CentOS 6.

I have installed Ubuntu 12.04 LTS on a Jiffybox.
I am therefore following Docker Installation instructions for Ubuntu for the installation instructions:

Install a kernel that is required by Docker:

sudo apt-get update
sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring

After that, in the admin website of JiffyBox, select the custom kernel Bootmanager 64 Bit (pvgrub64); see also the german JiffyBox FAQ. Then restart your JiffyBox.

After the restart, uname -a should show something like:

Linux j89610.servers.jiffybox.net 3.8.0-37-generic #53~precise1-Ubuntu SMP Wed Feb 19 21:37:54 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Now install docker:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
 
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
 
sudo apt-get update
sudo apt-get install lxc-docker

Create a Docker image
I realised that if I would install Kolab in one go, the image would become too big to upload to https://index.docker.io.
Therefore I have created a Dockerfile which has several steps for downloading and installing various packages. For a detailed description of a Dockerfile, see the Dockerfile Reference

My Dockerfile is available on Github: https://github.com/TBits/KolabScripts/blob/Kolab3.3/kolab/Dockerfile. You should store it with filename Dockerfile in your current directory.

This command will build a container with the instructions from the Dockerfile in the current directory. When the instructions have been successful, an image with the name tpokorra/kolab33_centos6 will be created, and the container will be deleted:

sudo docker build -t tpokorra/kolab33_centos6 .

You can see all your local images with this command:

sudo docker images

To finish the container, we need to run setup-kolab, this time we define a hostname as a parameter:

MYAPP=$(sudo docker run --name centos6_kolab33  --privileged=true -h kolab33.test.example.org -d -t -i tpokorra/kolab33_centos6 /bin/bash)
docker attach $MYAPP
# run inside the container:
  echo `hostname -f` > /proc/sys/kernel/hostname
  echo 2 | setup-kolab --default --timezone=Europe/Brussels --directory-manager-pwd=test
  ./initHttpTunnel.sh
  ./initSSL.sh test.example.org
  /root/stop.sh
  exit

Typing exit inside the container will stop the container.

Now you commit this last manual change:

docker commit $MYAPP tpokorra/kolab33_centos6
# delete the container
docker rm $MYAPP

You can push this image to https://index.docker.io:

#create a new account, or login with existing account:
sudo docker login
sudo docker push tpokorra/kolab33_centos6

You can now see the image available here: https://index.docker.io/u/tpokorra/kolab33_centos6/

See this post Installing Demo Version of Kolab 3.3 with Docker about how to install this image on the same or a different machine, for demo and validation purposes.

Current status: There are still some things not working fine, and I have not tested everything.
But this should be a good starting point for other people as well, to help with a good demo installation of Kolab on Docker.

Tags: , ,
Posted in Software Development | Comments Closed

This describes how to install a docker image of Kolab.

Please note: this is not meant to be for production use. The main purpose is to provide an easy way for demonstration of features and for product validation.

This installation has not been tested a lot, and could still use some fine tuning. This is just a demonstration of what could be done with Docker for Kolab.

Preparing for Docker
I am using a Jiffybox provided by DomainFactory for downloading a Docker container for Kolab 3.1 running on CentOS 6.

I have installed Ubuntu 12.04 LTS on a Jiffybox.
I am therefore following Docker Installation instructions for Ubuntu for the installation instructions:

Install a kernel that is required by Docker:

sudo apt-get update
sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring

After that, in the admin website of JiffyBox, select the custom kernel Bootmanager 64 Bit (pvgrub64); see also the german JiffyBox FAQ. Then restart your JiffyBox.

After the restart, uname -a should show something like:

Linux j89610.servers.jiffybox.net 3.8.0-37-generic #53~precise1-Ubuntu SMP Wed Feb 19 21:37:54 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Now install docker:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
 
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
 
sudo apt-get update
sudo apt-get install lxc-docker

Install container
The image for the container is available here:
https://index.docker.io/u/tpokorra/kolab31_centos6/
If you want to know how this image was created, read my other blog post http://www.pokorra.de/2014/03/building-a-docker-container-for-kolab-on-jiffybox.

To install this image, you need to type in this command:

docker pull  tpokorra/kolab31_centos6

You can create a container from this image and run it:

MYAPP=$(sudo docker run --name centos6_kolab31 -p 443:443 -h kolab31.test.example.org -d -t -i tpokorra/kolab31_centos6)

(-P should work instead of -p 443:443 and use the ports defined by EXPOSE in Dockerfile, but that does not work for me at the moment…)

You can see all your containers:

docker ps -a

You now have to attach to the container, and inside the container start the services:

docker attach $MYAPP
  /root/start.sh

Somehow it should work to start the services automatically at startup, but I did not get it to work with CMD or ENTRYPOINT.

To stop the container, type exit on the container’s console, or run from outside:

docker stop $MYAPP

To delete the container:

docker rm $MYAPP

You can reach the Kolab Webadmin on this URL:
https://localhost/kolab-webadmin. Login with user: cn=Directory Manager, password: test

The Webmail interface is available here:
https://localhost/roundcubemail.

Tags: , ,
Posted in Software Development | Comments Closed

Preparation
I am using a Jiffybox provided by DomainFactory for building a Docker container for Kolab 3.1 running on CentOS 6.

I have installed Ubuntu 12.04 LTS on a Jiffybox.
I am therefore following Docker Installation instructions for Ubuntu for the installation instructions:

Install a kernel that is required by Docker:

sudo apt-get update
sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring

After that, in the admin website of JiffyBox, select the custom kernel Bootmanager 64 Bit (pvgrub64); see also the german JiffyBox FAQ. Then restart your JiffyBox.

After the restart, uname -a should show something like:

Linux j89610.servers.jiffybox.net 3.8.0-37-generic #53~precise1-Ubuntu SMP Wed Feb 19 21:37:54 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Now install docker:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
 
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
 
sudo apt-get update
sudo apt-get install lxc-docker

Create a Docker image
I realised that if I would install Kolab in one go, the image would become too big to upload to https://index.docker.io.
Therefore I have created a Dockerfile which has several steps for downloading and installing various packages. For a detailed description of a Dockerfile, see the Dockerfile Reference

My Dockerfile looks like this:

FROM centos
RUN mv /etc/localtime /etc/localtime.old; ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
RUN echo "NAME=kolab31.test.example.org" > /etc/sysconfig/network; echo "kolab31.test.example.org" > /proc/sys/kernel/hostname
RUN chmod a+w /dev/shm
WORKDIR /root
RUN wget -O master.tar.gz https://github.com/tpokorra/kolab3_tbits_scripts/archive/master.tar.gz; tar xzf master.tar.gz; rm master.tar.gz
WORKDIR /root/kolab3_tbits_scripts-master/kolab3.1
RUN sed -i -e "s/^yum -y install kolab.*/#yum -y install kolab/" reinstallCentOS.sh
RUN echo "y" | ./reinstallCentOS.sh CentOS_6
# split yum -y install kolab into several steps,
# to keep the revisions small enough to avoid problems with uploading the image
RUN yum -y install php-kolabformat
RUN yum -y install mysql-server
RUN yum -y install kolab-cli
RUN yum -y install kolab-imap
RUN yum -y install 389-ds-base
RUN yum -y install java-1.6.0-openjdk
RUN yum -y install libgcj
RUN yum -y install kolab-ldap
RUN yum -y install kolab-webadmin
RUN yum -y install iRony
RUN yum -y install wallace
RUN yum -y install kolab-webclient
RUN yum -y install postfix
RUN yum -y install clamd
RUN yum -y install kolab-mta
RUN yum -y install qt-x11
RUN yum -y install libkolab
RUN yum -y install kolab patch unzip
# prepare for setup kolab
RUN ./initSetupKolabPatches.sh
# we cannot run setup-kolab here, because the hostname is no FQDN
# RUN setup-kolab --default --timezone=Europe/Brussels --directory-manager-pwd=test
# allow connections on port 443 (https)
EXPOSE 443
# TODO: allow IMAP as well
 
#CMD ["/sbin/init"]

This command will build a container with the instructions from the Dockerfile in the current directory. When the instructions have been successful, an image with the name tpokorra/kolab31_centos6 will be created, and the container will be deleted:

sudo docker build -t tpokorra/kolab31_centos6 .

You can see all your local images with this command:

sudo docker images

To finish the container, we need to run setup-kolab, this time we define a hostname as a parameter:

MYAPP=$(sudo docker run --name centos6_kolab31 -h kolab31.test.example.org -d -t -i tpokorra/kolab31_centos6 /bin/bash)
docker attach $MYAPP
# run inside the container:
  echo `hostname -f` > /proc/sys/kernel/hostname
  setup-kolab --default --timezone=Europe/Brussels --directory-manager-pwd=test
  ./initSSL.sh
  cat > /root/start.sh << EOF
#!/bin/bash
service httpd start
service mysqld start
service dirsrv start
service cyrus-imapd start
sleep 10
service kolabd start
service kolab-saslauthd start
EOF
  chmod a+x /root/start.sh
  service kolabd stop
  service dirsrv stop
  service cyrus-imapd stop
  service mysqld stop
  service httpd stop
  exit

Typing exit inside the container will stop the container.

Now you commit this last manual change:

docker commit $MYAPP tpokorra/kolab31_centos6
# delete the container
docker rm $MYAPP

You can push this image to https://index.docker.io:

#create a new account, or login with existing account:
sudo docker login
sudo docker push tpokorra/kolab31_centos6

You can now see the image available here: https://index.docker.io/u/tpokorra/kolab31_centos6/

See this post Installing Demo Version of Kolab 3.1 with Docker about how to install this image on the same or a different machine, for demo and validation purposes.

Current status: There are still some things not working fine, and I have not tested everything.
But this should be a good starting point for other people as well, to help with a good demo installation of Kolab on Docker.

Tags: , ,
Posted in Software Development | Comments Closed

This post covers several topics at once:

I have got some experience with OpenVZ, and was looking how LXC could satisfy the requirements that I am used to. Especially how to install several Linux distributions on one LXC host. I will show how to install CentOS, Ubuntu, and Debian Wheezy on a Ubuntu LXC container.

The other issue is that I wanted to play with a virtual machine called JiffyBox provided by DomainFactory.

Let’s look first at how to configure the JiffyBox, before we configure the LXC containers:

This post on the web Linux Containers (lxc) in Linode (xen)  helped me to understand how LXC works fine on a JiffyBox.
With the default kernel from JiffyBox, lxc-checkconfig shows that some requirements for LXC are missing.
JiffyBox allows you to start from a custom kernel. Now I was looking for a fitting kernel to install.
I have no idea how to do that on CentOS, but on the mentioned blog I found that Ubuntu can easily install a kernel that works fine for virtualization.

So you install a 64 bit Ubuntu JiffyBox, and then run these commands to setup LXC:

apt-get install lxc linux-virtual

After that, in the admin website of JiffyBox, select the custom kernel Bootmanager 64 Bit (pvgrub64); see also the german JiffyBox FAQ. Then restart your JiffyBox.

After the restart, uname -a should show something like:

Linux j80074.servers.jiffybox.net 3.2.0-58-virtual #88-Ubuntu SMP Tue Dec 3 17:58:13 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Now we will install some virtual machines:

First an Ubuntu 12.04 (precise) machine, which should work without any problems:

lxc-create -t ubuntu -n demo1
lxc-start -n demo1

You can login with username ubuntu, and password ubuntu. To get out of the machine, you type shutdown -h now.

To make the machine start at boot time, and to visit the console once the machine is running, type this:

ln -s /var/lib/lxc/demo1/config /etc/lxc/auto/demo1.conf
lxc-console -n demo1

By the way: you find the templates in /var/cache/lxc/, and the containers in /var/lib/lxc/.

For Debian, there is a template in directory /usr/lib/lxc/templates, but that is for Debian 6 (Squeeze). You need to slightly modify the template, so that Debian 7 (Wheezy) is installed. See my gist for that: Debian Wheezy template file

wget https://gist.github.com/tpokorra/8488744/raw/f1d050704e8cc8c70dd956eb18e6374d70f8ecf6/lxc-debian-wheezy
mv lxc-debian-wheezy /usr/lib/lxc/templates/lxc-debian-wheezy
chmod a+x /usr/lib/lxc/templates/lxc-debian-wheezy
lxc-create -t debian-wheezy -n demo2

You can login with username root and password root.

For CentOS, I have modified an existing Gist, so that it works for the latest CentOS 6.5. You might to check the latest differences in the revision, to adjust the script to future releases of CentOS. Have a look at my gist for lxc-centos.

wget https://gist.github.com/tpokorra/8488836/raw/dbcd0920c1b9047da707c318190959cf64d72f7c/lxc-centos
mv lxc-centos /usr/lib/lxc/templates/lxc-centos
chmod a+x /usr/lib/lxc/templates/lxc-centos
apt-get install yum
lxc-create -t centos -n demo3

You can login with username root and password password.

Install Kolab3 on Jiffybox   May 29th, 2013

When running setup-kolab, after a timeout during the set up of the 389 Directory Server, see /var/log/kolab/setup.error.log:

Failed to create semaphore for stats file (/var/run/dirsrv/slapd-kolab.stats). Error 13.(Permission denied)

There was already a mounted tmpfs, but the directory /dev/shm was not writeable for user nobody.

So, before you run setup-kolab, you might want to run:

chmod a+rwx /dev/shm

And to make this lasting for the next reboot, you need to modify the /etc/fstab file: Make sure the line containing /dev/shm looks like this:


tmpfs /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0

It seems, ls -la /dev/shm still shows wrong permissions, therefore add to /etc/rc.local:

chmod a+w /dev/shm
service dirsrv restart
Tags: ,
Posted in Software Development | Comments Closed