Tag Archives: Linux

Installing Kolab 3.2 on CentOS

Kolab the open-source groupware collaboration project released version 3.2 on Valentines day. I have been on version 3.0 for some time now and wanted to get away from using ownCloud and some other projects and just use Kolab as it was doing my mail, contacts and calendaring anyway.

The installation process is not all that difficult, here is what I did to install the software.

Lets get some utilities.

# yum install wget
# yum install nano

First we need to prepare the target system. The document http://docs.kolab.org/installation-guide/preparing-the-system.html tells us we need to relax the SELinux policy.

# setenforce 0

Lets also make it persist across reboots.

nano /etc/selinux/config

Change `enforcing` to `permissive`.

At this point (since this is a completely internal install) I wanted to disable the iptables firewall. (We can re-enable later after it’s all working).

# /etc/init.d/iptables stop
# chkconfig iptables off

Kolab has some very strict DNS requirements for how this machine refers to itself, and how people locate this machine.

# hostname -f

This needs to be exactly how you connect to this server via the web interface. If this is not how your external DNS will handle this servers FQDN you need to fix your hosts file.

# nano /etc/hosts

Follow the steps @ http://docs.kolab.org/installation-guide/centos.html

First we need to install EPEL. (At the time of this post, this is the most current RPM you need for EPEL.)

# rpm -Uhv http://mirror.chpc.utah.edu/pub/epel/6/i386/epel-release-6-8.noarch.rpm

Next download some files with wget that add the Repos.

# cd /etc/yum.repos.d/
# wget http://obs.kolabsys.com:82/Kolab:/3.2/CentOS_6/Kolab:3.2.repo
# wget http://obs.kolabsys.com:82/Kolab:/3.2:/Updates/CentOS_6/Kolab:3.2:Updates.repo

Next we can install all the packages Kolab needs.

# yum install kolab

After all these are installed we (at this time, its a bug that needs fixing) need to fix the template script for amavisd.conf

# nano /usr/lib/python2.6/site-packages/pykolab/setup/setup_mta.py

Look around line `386` the small block should look like the following

        if os.path.isdir('/etc/amavisd'):
            fp = open('/etc/amavisd/amavisd.conf', 'w')
        elif os.path.isdir('/etc/amavis'):
            fp = open('/etc/amavis/amavisd.conf', 'w')

Take a look under the second line, it opens the file but does not write and then close it. We need it to do this or we will get a zero byte empty amavisd.conf file.

If yours looks like the above make it look like this

        if os.path.isdir('/etc/amavisd'):
            fp = open('/etc/amavisd/amavisd.conf', 'w')
        elif os.path.isdir('/etc/amavis'):
            fp = open('/etc/amavis/amavisd.conf', 'w')

You see I have added two lines under the second. Save the file and exit.

Now we can continue installing Kolab.

# setup-kolab

During this install you will be asked for many passwords. Write down the defaults or make up your own passwords.

After the install is complete, I reboot the system to make sure all services are started and that everything loads correctly.

We now need to update the database schema. At this time, even on a fresh install the database schema is out of date. I found this out by finding some odd bugs and talking about them in the Kolab IRC channel. After running the update database script they all went away.

# cd /usr/share/roundcubemail/
# ./bin/updatedb.sh --dir plugins/libkolab/SQL --package libkolab
# ./plugins/libkolab/bin/modcache.sh clear -a

I changed my Kolab web services to run off a different port, I had to edit `nss.conf` which is part of Apache.

# nano /etc/httpd/conf.d/nss.conf

Two parts of this file need to be changed if you want to change from the default SSL port that Kolab ships with. The default SSL port is 8443. Find the lines

Listen 8443
VirtualHost _default_:8443

Change the two mentions of 8443 to your own port.

If your going to be using only SSL then we need to make a few more changes in some files.


# nano /usr/share/roundcubemail/config/config.inc.php

I added the following lines under the `$config[‘db_dsnw’] value.

    $config['calendar_caldav_url'] = "https://your.fqdn.tld:8443/iRony/calendars/%u/%i";
    $config['kolab_addressbook_carddav_url'] = 'https://your.fqdn.tld:8443/iRony/addressbooks/%u/%i';

Change the FQDN and the ports to match your setup.


# nano /usr/share/roundcubemail/config/kolab_files.inc.php

I change the `kolab_files_url` variable by adding an `s` to `http`

$config['kolab_files_url'] = 'https://' . $_SERVER['HTTP_HOST'] . '/chwala/';

There might be more files that need some changing, but I have not found any that need it yet.

This should get you on to the next step http://docs.kolab.org/installation-guide/first-login.html

Using iRony+Chwala as a WebDAV server your URL is:


1. If you visit your Address Book and notice nothing shows up, you import and nothing shows. You turn off cache in libkolab.conf and the contacts show up? You need to run the database update script.

2. If you turn cache off and contacts work but the cloud files break you need to run the database update script.

3. If the buttons on the files page are disabled you might need to go through and verify all URLs are correct for HTTP(s). Verify your FQDN, DNS Settings at your provider, and check your hosts file for correct entries. It seems that the files page is very picky and requires that from the page be able to loop back and see itself. So all your hostnames, and FQDNs have to be exactly as they are. If your using SSL be sure to edit the files I mention on this page and change http to https that are hardcoded in the PHP files.

ArchLinux on OVH Dedicated Server

OVH offers (at the moment) two ArchLinux distributions. One is not working as of this writting and the other is fairly old, and has a mix of initd and systemd parts. The partition wizard for the control panel is not great either.

I wanted to install a clean ArchLinux base and was looking around how to do it easily and correctly from the offered rescue-cd bootable they offer which happens to be a debian variant.

I found the following site: http://guillaumejcharmes.blogspot.com/2012/12/up-to-date-arch-linux-kernel-with.html.

Here are the important parts:

> gdisk /dev/sda
> mkfs -t ext4 /dev/sda1

> mount /dev/sda1 /mnt
> mkdir /mnt/tmp
> cd /mnt/tmp

> wget http://tokland.googlecode.com/svn/trunk/archlinux/arch-bootstrap.sh
> sh arch-bootstrap.sh -a x86_64 /mnt
> wget -O /mnt/tmp/havegen.tar.xz https://www.archlinux.org/packages/community/x86_64/haveged/download/

> mount -o bind /dev /mnt/dev
> mount -o bind /dev/pts /mnt/dev/pts
> mount -t proc /prorc /mnt/proc
> mount -t sysfs /sys /mnt/sys
> chroot /mnt

> cd /
> tar xJf /tmp/havegen.tar.xz
> havegen -w 1024

> pacman-key –init
> pacman-key –populate

> pacman -S base base-devel syslinux gdisk openssh sudo cmake
> gensftab / > /etc/fstab

# Create your hostname file: /etc/hostname containing the hostname of the system.

> nano /etc/locale.gen
> locale-gen
> ln -s /usr/share/timeinfo/America/New_York /etc/localtime

> mkinitcpio -p linux

> syslinux-install_update -i -a -m

> cp /etc/netctl/examples/ /etc/netctl
> netctl enable

> systemctl enable sshd.socket

# Modify /etc/systemd/system/sockets.target.wants/sshd.socket to change the port SSHD listens on.

Apache, PHP, suPHP Problems

Last night if you tried visiting you might have gotten some errors on the site. I upgraded the servers which included a slightly newer version of PHP, Apache, and suPHP.

Everything upgraded fine but websites would not load. After some digging it was apparent that the problem was directly related to the PHP setting open_basedir. I have each virtual host configured to use its own php.ini file and that file was not being used, trying instead to use the default php.ini file in /etc/php. Which of course did not have the correct open_baseidir settings.

For some reason Apache or PHP stopped caring about the lines in my httpd-vhosts.conf file that stated:

SetEnv PHPRC /path/to/specific/php.ini

I could never find out why it was ignoring this line now. But after some research I found another that provides the same thing. Since I am using suPHP I went with the following for each vhost.

suPHP_ConfigPath /path/to/specific/folder/containing/php.ini

It’s a little frustrating that I cannot name the php config files after the vhosts because it wants a folder path without a file name, but it will do for now.

Another site that might help.

Android Tips, Commands, Modifications

[mod][root][needs init.d enabled kernel]
Change Hostname:

$ su
# vi /system/etc/init.d/99hostname

Type in

setprop net.hostname tablethostname

Save the file, reboot.

Change System DNS Servers:

$ su
# vi /system/etc/resolv.conf

If the file does not exist or is empty, just create it.

Type in


Those are google DNS servers, or specify your own.
Save file, possibly reboot tablet.

Android Global DNS Server (resolv.conf)

Android, being Linux reads the /etc/resolv.conf file if it exists to set DNS servers.

On my devices, /etc links to /system/etc

Here is a link to help set this up.