# Kolab server install script for gentoo

## sebest

I wrote a script to easyly install the kolab (kroupware) server

You can download it at

http://gentoo.ovibes.net/install-kolab.sh

It will download, compile and install everything in /kolab

as explained in the installation doc:

http://www.erfrakon.de/projects/kolab/download/kolab-server-1.0/src/QIM

I'd like some feedback about it

thanx

----------

## Stalione

Is anyone working on an ebuild for this? I am running this script as I post this and things are going really smooth.  I did notice that it used rpm's for apache 1.3.27, many apache modules, and various others things.  Also I am noticing that it is compiling a lot of thing, so im confused exactly what its doing.

----------

## Stalione

I got the following error.  

 *Quote:*   

> 
> 
> -openpkg_opts: unknown option
> 
> error: cannot open file /kolab/RPM/PKG/perl-openpkg*kol.rpm: No such file or directory 
> ...

 

On line 133 you are calling <package_name>_opts.  But only the following files exist in /kolab/RPM/PKG folder:

```

toolbox PKG # ls -l

total 19960

-rw-r--r--    1 root     root      2602619 Nov 23 08:23 binutils-2.14-20030613.ix86-linux2.6-kol.rpm

-rw-r--r--    1 root     root        97476 Nov 23 09:30 expat-1.95.6-20030130.ix86-linux2.6-kol.rpm

-rw-r--r--    1 root     root       121382 Nov 23 09:28 fsl-1.1.0-20030522.ix86-linux2.6-kol.rpm

-rw-r--r--    1 root     root      6543938 Nov 23 09:26 gcc-3.3-20030614.ix86-linux2.6-kol.rpm

-rw-r--r--    1 root     root       168083 Nov 23 08:11 make-3.80-20030109.ix86-linux2.6-kol.rpm

-rw-r--r--    1 root     root      1305441 Nov 23 09:36 ncurses-5.3.20030614-20030615.ix86-linux2.6-kol.rpm

-rw-r--r--    1 root     root        50206 Nov 23 08:12 patch-2.5.9-20030520.ix86-linux2.6-kol.rpm

-rw-r--r--    1 root     root      9234126 Nov 23 09:56 perl-5.8.0-20030409.ix86-linux2.6-kol.rpm

-rw-r--r--    1 root     root        95024 Nov 23 09:29 procmail-3.22-20030330.ix86-linux2.6-kol.rpm

-rw-r--r--    1 root     root       151944 Nov 23 09:31 readline-4.3-20020718.ix86-linux2.6-kol.rpm

-rw-r--r--    1 root     root        44319 Nov 23 09:30 zlib-1.1.4-20030227.ix86-linux2.6-kol.rpm 

```

----------

## sebest

it should be fixed now, it was a bug:

the name of variables had a "-"

like perl-openpkg_opts

and bash interprets $perl-openpkg_opts like $perl has a variable and -openpkg_opts has a string and not as the full name of the variable

i fixed it replacing "-" by "_"

hope it works now, i updated my script to fix it

thanx for testing

----------

## Stalione

I will run the new script again, but I am not sure other than deleting /kolab folder what else can I do to ensure that its a clean install?  Also I noticed that the script is installing a lot of packages that I would rather install using Gentoo portage.  For example apache, php.  What do you suggest? Should I stick with what the kolab script installs?  If so, what about future upgradability?  Specially since I'm considering apaceh 2.0.  Right now on the test box i'll re-run the script but I patiently await your reply.

----------

## sebest

i took care of this issue, if you relaunch the script it won't download the file again and it will script the package that are already compiles, so you can launch it again.

if you want to run kolab you can't use the apache,php, openldap etc of gentoo packages,  because the kolab version of these packages are modified, patched and have special config file to work together, that's why it's so hard to write an ebuild for kolab.

I my opinion, if you want kolab, you don't have much choice...

----------

## Stalione

So far I have only found a tiny little typo on line 108 where you are missing a quote around yes.  The line should say

```

if [ ${DOWNLOAD} == "yes" ]

```

Also I commented out the line that created kolab_src dir since I already have it and its populated.

(line 106).  Perhaps this should be changed to something like:

```

KOLABSRC_DIR=$PWD/kolab_src

 if [ ! -d $KOLABSRC_DIR ]; then

         mkdir -p $KOLABSRC_DIR

         echo "Creating Kolab Src directory" 

 fi

```

----------

## sebest

thanx, i fixed it  :Wink: 

I'll improve this script and clean it when i'll have more time. (i wrote it quickly and then decided that it mays be usefiull for others)

----------

## Stalione

Ah! i didn't even notice you responded to me  :Smile:  .  Well if that is the case that would mean that I might have to run this server as a dedicated kolab server or try to install everythign else around kolabs install.  Oh well.  It might not be as clean and manageable of an environment as I would have liked it to be but considering my options (exchange), ill stick with kolab.

So what happens if i have to upgrade apache/php etc on this kolab box? do i wait for them to relase an updated package or can i just download the latest source and use the same spec file given by kolab group?  Man this is going to be a management hell.

----------

## sebest

in fact i think that they will fix every bug that could affect kolab and packages  that are related to it (apache , php etc), to upgrade you'll have to download the package and install it like this:

rpm -Uvh package.src.rpm

rpm -bb /kolab/RPM/SRC/package/package.spec

rpm -Uvh /kolab/RPM/package.rpm 

Just like you would do on a rpm based distrib.

The easiest way to package kolab for gentoo would be to write ebuild like:

kolab-apache, kolab-perl, kolab-ertc...

and kolab would be a meta ebuild that depends on kolab-*

each of these kolab-...ebuild would install the rpm.

I think that some ebuilds already install rpm for packages that only in this format.

The other solution would be to extract the tar.gz from the rpm and write an ebuild based on the spec file of the rpm, it would be cleaner and more integrated in portage, but also more work for the ebuild write  :Wink: 

----------

## sebest

But i think we needn't to write an ebuild for every package, some package like perl-* could used the package from the portage.

But for the big component like, cyrus, apache,mod_php, openldap, it would be better to separate them by installing them in /kolab, or better, in /opt/kolab.

----------

## Stalione

Sebest,

     I just realiazed I never thanked you for posting the script!  Thanks!  So I take it that you already have a nice kolab env. working?  If so do you have any tips for me?  Also prior to installing kolab I already had ldap working on this box and it was also setup to authenticate users via pam+ldap.  Now that im installing kolab, does it mean that all that work I put into configuring ldap is a waste, in other words is kolab going to force me to configure its own patched version of openLDAP or is it going to play along nicely with the existing one?  

The server I am building is also supposed to act as a subversion server, ftp, and web server.  Kolab is already install proftpd, so I guess that will take  care of ftp.  As for subversion, I hope there won't be any issues with user authentication.  As for the web server, I guess i'll try to work with the apache installed by kolab, i just worry that it might cause issues with future upgrades since I will be running some forum software like phpbb, or perhaps something more involved.

----------

## sebest

thanx  :Smile: 

it's sure that it's better to have a dedicated server for kolab, but you can put other services on it.

for the ldap i think that you can import you schema into the openldap of kolab

our you could run your openldap on another port number

the same for apache, you could install apache 2, and then change the port number used by kolab, for example 8080 and 8443, and then create a vhost in your apache2 config to proxify (mod_proxy) or rewrite (mod_rewrite) to access the kolab apache server.

About ftp it' not mandatory to run the ftp server of kolab, i think it's only usefull to publish some info about but/out of office. And you can control it from the web admin of kolab 

changing the portnumber of the apache kolab may be possible, but take care of the configuration of WebDAV.

I think you work on ldap can be integrated and is not waste. Maybe you could even authenticate from the schema of kolab_openldap, it may not be so much different from yours, just check it. There is no reason they don't use the standar NIS schema.

About the patch and modif that the kolab team applyed, there is a document:

http://kroupware.org/documentation.html

the technical description and the architecture paper may be usefull to answer your questions.

hope it can help you

----------

## Stalione

The good news is that the new script worked and installed everything, the bad news is that when it started to bootstrap process, asking me for server name, domain name etc (to configure ldap), it ended up puking probably because I already had LDAP running and my admin account on the LDAP is root and not manager.  More over there could have been port binding issues.  Right now im creating an image of the server, once im done ill go forward with configuration.

----------

## viperx

sebest I've tried to get kolab to install but still am getting an error

./openpkg-20030606-20030606.src.sh: extracting to openpkg-20030606-20030606.src...

./openpkg-20030606-20030606.src.sh: line 81: uudecode: command not found

cat: openpkg-20030606-20030606.src.tar.Z: No such file or directory

./openpkg-20030606-20030606.src.sh: extraction done.

./openpkg-20030606-20030606.src.sh: building for /kolab...

./openpkg.boot: ./openpkg.boot: No such file or directory

any suggestions?

----------

## Stalione

I was trying to run the bootstrap process manually and got the following error.  As you can see prior to running bootstrap I made sure all the daemons were running just fine.  I am not sure why its erroring out.  Any ideas?  Also the slapd.conf file I had in my /kolab/etc/openldap folder was corrupt.  It had a lot of ^[[D symbols in front of all dc= statements.  I manually entered the correct dc= statements and only then /etc/init.d/openpkg-kolab script was able to start all services without error.  After trying to run the bootstrap manullay I noticed that it has corrupted the slapd.conf file again.  The contents of slapd.conf look like this now

 *Quote:*   

> 
> 
> access to attr=userPassword
> 
>         by group="cn=admin,dc=^[[D" write
> ...

 

```

toolbox openldap # netstat -alnp | grep -v unix

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

tcp        0      0 127.0.0.1:993           0.0.0.0:*               LISTEN      7115/cyrmaster

tcp        0      0 127.0.0.1:995           0.0.0.0:*               LISTEN      7115/cyrmaster

tcp        0      0 0.0.0.0:389             0.0.0.0:*               LISTEN      7148/slapd

tcp        0      0 127.0.0.1:110           0.0.0.0:*               LISTEN      7115/cyrmaster

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7095/apache

tcp        0      0 127.0.0.1:2003          0.0.0.0:*               LISTEN      7115/cyrmaster

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      3520/sshd

tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      7213/master

tcp        0     44 170.200.11.200:22       170.200.93.5:3013       ESTABLISHED 5120/0

tcp        0      0 127.0.0.1:32772         127.0.0.1:389           TIME_WAIT   -

udp    13760      0 0.0.0.0:68              0.0.0.0:*                           2928/dhcpcd

Active UNIX domain sockets (servers and established)

Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path

toolbox openldap # ls

ldap.conf  schema  slapd.conf

toolbox openldap # cp slapd.conf slapd.conf.mod

toolbox openldap # cd /kolab/

toolbox kolab # /kolab/etc/kolab/kolab_bootstrap -b

KOLAB BOOTSTRAP

Please enter Hostname [toolbox]:

proceeding with Hostname toolbox

Please enter your Maildomain [toolbox]:truenorth.com

proceeding with Maildomain truenorth.com

prepare LDAP database...

kill running slapd (if any)

temporarily start slapd

/kolab/etc/openldap/slapd.conf: line 51: regular expression "cn=admin,dc" bad because of Invalid regular expression

<access clause> ::= access to <what> [ by <who> <access> [ <control> ] ]+

<what> ::= * | [dn[.<dnstyle>]=<regex>] [filter=<ldapfilter>] [attrs=<attrlist>]

<attrlist> ::= <attr> | <attr> , <attrlist>

<attr> ::= <attrname> | entry | children

<who> ::= [ * | anonymous | users | self | dn[.<dnstyle>]=<regex> ]

        [dnattr=<attrname>]

        [group[/<objectclass>[/<attrname>]][.<style>]=<regex>]

        [peername[.<style>]=<regex>] [sockname[.<style>]=<regex>]

        [domain[.<style>]=<regex>] [sockurl[.<style>]=<regex>]

        [ssf=<n>] [transport_ssf=<n>] [tls_ssf=<n>] [sasl_ssf=<n>]

<dnstyle> ::= regex | base | exact (alias of base) | one | subtree | children

<style> ::= regex | base | exact (alias of base)

<groupflags> ::= R

<access> ::= [self]{<level>|<priv>}

<level> ::= none | auth | compare | search | read | write

<priv> ::= {=|+|-}{w|r|s|c|x}+

<control> ::= [ stop | continue | break ]

could not connect ldap server at /kolab/etc/kolab/kolab_bootstrap line 161.

Can't call method "bind" without a package or object reference at /kolab/etc/kolab/kolab_bootstrap line 163.

```

----------

## viperx

http://kolab.kde.org/cvs-kolab.html

this might help

----------

## sebest

 *viperx wrote:*   

> sebest I've tried to get kolab to install but still am getting an error
> 
> ./openpkg-20030606-20030606.src.sh: extracting to openpkg-20030606-20030606.src...
> 
> ./openpkg-20030606-20030606.src.sh: line 81: uudecode: command not found
> ...

 

As you can see it's : "uudecode: command not found"

so you need to have uudecode

try to emerge it, it is in app-arch/sharutils

----------

## sebest

the init script include in the kolab distrib doesn't work well for gentoo, i modified it a little:

```

#!/sbin/runscript

##

##  kolab -- startup/shutdown transfer script for OpenPKG /kolab hierarchy

##

depend() {

    need net

}

checkconfig() {

    [ -f /kolab/etc/rc ] || return 1

    case non-privileged in

        start ) exec /kolab/etc/rc kolab start ;;

        stop  ) exec /kolab/etc/rc kolab stop  ;;

    esac

}

start() {

    checkconfig || return 1

    ebegin Starting kolab hierarchy

    exec /kolab/etc/rc kolab start

    eend 0

}

stop() {

    checkconfig || return 1

    ebegin Stopping kolab hierarchy

    exec /kolab/etc/rc kolab stop

    eend 0

}

```

i replaced the "all" by "kolab" because kolab starts apache, proftpd, imap etc etc, and if you leave "all", it will start kolab, apache etc etc

so you'll end up starting apache, imap postfix etc 2 times, one because of starting kolab and one for starting each other programs individually.

----------

## ramon

Hi,

Thanks a lot for the script. It worked flawlessly and installed /compiled everything perfectly.

However after the initial install I created a test user and tried to send him a mail.

This returns with 550 - MailBox unknown or no acces.

I looked around in the log-files and found that postfix is accepting the mail-address.

lmtp transport is the failure point.

```

Mar 19 16:25:04 mail <info> postfix/lmtp[18177]: 6710A11256: to=<ramon@forgottenland.net>, relay=/kolab/var/kolab/lmtp[/kolab/var/kolab/lmtp], delay=18, status=bounced (host /kolab/var/kolab/lmtp[/kolab/var/kolab/lmtp] said: 550-Mailbox unknown.  Either there is no mailbox associated with this 550-name or you do not have authorization to see it. 550 5.1.1 User unknown (in reply to RCPT TO command))

```

However when I connect with KMail to the imap server it allows me to check my mailbox.

```

Mar 19 16:26:15 mail <notice> imapd[18181]: login: mordor[192.168.0.20] ramon@forgottenland.net plaintext+TLS

Mar 19 16:26:18 mail <debug> imapd[18181]: seen_db: user ramon@forgottenland^net opened /kolab/var/imapd/user/r/ramon@forgottenland^net.seen

Mar 19 16:26:18 mail <debug> imapd[18181]: open: user ramon@forgottenland^net opened INBOX

Mar 19 16:26:23 mail <debug> imapd[18181]: open: user ramon@forgottenland^net opened INBOX

```

I checked the ldap database and the user is present there.

I have no clue why the lmtp delivery is going wrong, anyone?

Thanx,

Ramon

----------

## sebest

look a this thread on the kolab forum:

http://eforum.de/viewtopic.php?t=77

he seems to have exactly the same problem

you may contact him by email to know if he found a solution.

----------

## sebest

I think it could be that you append yout domain name to the name of your user.

In my impad logs i only see USENAME opened INBOX/....

and NOT USERNAME@domain.com opened INBOX/...

so you should create user ramon and NOT ramon@forgottendland.net ....

in fact you should send your mail to ramon@forgottendland.net@forgottendland.net ....

Try to create username, without the domain name(because it must be implecit)

----------

## pansolero

Hi!

I tried your script, but it fails after downlooading all the files:

FINISHED --13:34:44--

Downloaded: 18,005 bytes in 1 files

-bb: unknown option

error: File not found by glob: /kolab/RPM/PKG/make-[0-9]*kol.rpm

-bb: unknown option

error: File not found by glob: /kolab/RPM/PKG/patch-[0-9]*kol.rpm

-bb: unknown option

error: File not found by glob: /kolab/RPM/PKG/binutils-[0-9]*kol.rpm

-bb: unknown option

[snipped all the other files]

error: File not found by glob: /kolab/RPM/PKG/proftpd-[0-9]*kol.rpm

-bb: unknown option

error: File not found by glob: /kolab/RPM/PKG/kolab-[0-9]*kol.rpm

./install-kolab.sh: line 161: /kolab/etc/kolab/kolab_bootstrap: No such file or directory

usermod: user kolab-r does not exist

I just emerged rpm, version 4.2_pre069. "rpm -bb" gives me "-bb: unknown option".

Whats wrong with my rpm?

----------

## sebest

i found this after googling a bit:

# Q) When running "rpm -ba", "rpm -ta" or "rpm --rebuild" I get the error "-ba: unknown option" or "--rebuild: unknown option" or "-ta: unknown option".

# A) With the Red Hat 8.0 release, the building options were removed from the "rpm" command. Use the "rpmbuild" command instead ("rpmbuild --rebuild python2.3-2.3-1pydotorg.src.rpm").

so maybe you should replace rpm -bb , with the appropriate rpmbuild options equivalent to -bb

good luck and keep us inform, thanx  :Wink: 

i'll update my script appropriately asap.

----------

## wrc_fan

well i got it all installed and running ok. but I can't seem to get any client to work with it.  Not aethera, not outlook with the bynari plugin, and not the cvs version of kdepim.  i can check my email ok, but i can't get it to sync the contacts and calendar.

----------

## sebest

could you send me the fixed version of the install script (or better, only a diff)

about aethera, it should work ok

for windows, don't use bynari but instead the toltec connector:

http://www.toltec.co.za/

i think that you don"t need kdepim cvs if you have the last version of kde 3.2.1 you can use kontact

the contact and calendar are stored in imap folder they are only emails in a special format.

----------

## wrc_fan

 *sebest wrote:*   

> could you send me the fixed version of the install script (or better, only a diff)
> 
> about aethera, it should work ok
> 
> for windows, don't use bynari but instead the toltec connector:
> ...

 

I compiled the kdepim cvs in order to get the kolabwizard.  Also I did that last after trying Aethera and Outlook didn't work.  I noticed in kontact that when I run it from the terminal I see some errors about imap4 folder access failing (sorry I don't have the specific response as I'm not at my linux box).  I tried having both INBOX as the imap path prefix and also leaving it empty, but neither one worked.

----------

## pansolero

I've now tried the openpkg-version of kolab at www.zfos.org, which installed without a hitch. Everything started ok, but I have the same problem as wrc_fan. Aethera doesn't seem to communicate with kolab at all (except for emails, which work), I haven't found out how to set kolab as resources for kde addressbook and calendar, kmail crashes while trying to enable the groupware functionality and outlook 2003 doesn't seem to work right with the toltec plugin.

wrc_fan, is there some kind of evaluation version of the bynari plugin?

greetings!

----------

## sebest

i've setup kolab with outlook XP+toltec v1.5 without any problem

You should look at the logs of your kolab server and post it here, maybe i could help you.

There is sometimes problems with the auth of the imap server.(MD5-CRAM)

----------

## wrc_fan

There is a 30 day demo version

the error I get in aethera when I'm trying to choose Kolab Synchronization for the datebook or contacts is: "imap4handler: mount: wrong folder url"

In kontact I believe I figured out the problem. Under kmail settings -> Misc -> Groupware, there is an option "Resource folders are subfolders of:" and mine was selectted as "inbox", but you need to select " inbox" which is under the "kolab" option.  The only problem is when I try to choose that and hit Apply it prompts that it will create the folders then crashes.

The even weirder thng is that for neither of these do any errors show up in /kolab/var/imapd/log/imapd.log or /kolab/var/postfix/log/postfix.log

So I think it has to be a client configuration error.[/url]

----------

