Kolab2 on Amazons EC2
From Kolab Wiki
While the above warning is important it should not stop you from testing the Kolab server on the EC2 network. It is the quickest method to get a server up and running and discover its many features.
Getting an AWS account
The basic prerequisite for Kolab on EC2 is an AWS account. Just go to the AWS website and enter your details there. The account itself does not cost you anything. Only the computing power you use will be charged.
Make sure you note down your access key ID as well as your secret access key. You'll find both on the Access identifiers page (see below).
Amazon provides some command line tools to access and manage the resources used within AWS. In addition the company offers an extension to Firefox - "Elasticfox". This extension makes it even easier to manage the resources you use and thus this article only describes the use of this tool.
Install Elasticfox in the firefox browser by downloading it from the Elasticfox page. Restart Firefox and select the Elasticfox application from your Extras menu.
Select the Credentials button in the upper right area (see below) and enter your AWS access identifiers.
Preparing the prerequisites
Before you can fire up a Kolab server you will need to have two things:
- a ssh key for connecting to the server
- a security group definition that allows access to the server
The ssh key can be created using the Key Pairs tab in Elasticfox. Just select the green Add key button, enter a new name, and save the key in your favourite location (see below).
Defining the security group is slightly more elaborate as you need to define all the ports that should be opened in the firewall. You can use the corresponding Security groups tab in Elasticfox (see below). If you plan on using AWS more often you should use a new Kolab specific security group. Otherwise you can also use your default security group.
Starting the server
Go back to the AMIs and Instances tab and search for AMIs that contain the name Kolab (see below). The owner column will only contain a number in your case.
Right click on the desired image and choose Launch instance(s) of this type. In the new window (see below) you don't need to change anything besides selecting the key pair you want to use and the security group for the server. Once you finished you can start the server with Launch.
Please note: once you select Launch Amazon will start to charge you for the instance you started.
Connecting to the server
After two or three minutes the new Kolab server instance should have started successfully and a click on Refresh in the Your instances section should indicate this with a green color. You can now connect manually by right clicking the running instance and selecting Copy public DNS Name to Clipboard (see below).
As an alternative you could also configure Elasticfox to start an ssh-connection within a terminal for you. The necessary parameters can be entered after clicking the Tools button.
Now you use ssh to connect to the new server. You will need the ssh key you created earlier.
ssh -i MY_AWS_SSH_KEY.pem email@example.com
If the connection is successful (see below) you are nearly done and all that is left to do is to bootstrap the system.
Bootstrap the server
Kolab-Server >= 2.2.2
Nothing unusual needs to be done for EC2 images of these Kolab Server versions and simple bootstrapping is enough. For lower versions you need to follow the steps mentioned in the sections below prior to bootstrapping the server as described here.
The server can be configured as usual by running kolab_bootstrap:
For a simple test run you should use the servers DNS name as FQDN:
Please enter Hostname including Domain Name (e.g. thishost.domain.tld) [domU-12-31-38-01-B8-13.localdomain]: ec2-75-101-251-205.compute-1.amazonaws.com
Use the same name as the mail domain:
Please enter your Maildomain - if you do not know your mail domain use the fqdn from above [compute-1.amazonaws.com]: ec2-75-101-251-205.compute-1.amazonaws.com
All other questions should receive the default answer. Once you finished the dialog you should start the server by running
/kolab/bin/openpkg rc all start
If all went well you can now connect to the admin frontend using the url provided at the end of the configuration dialog.
Kolab-Server > 2.1.0 and Kolab-Server < 2.2.2
First of all you should ensure that the server knows its external DNS address. Edit /etc/hosts for that and make sure the line with 127.0.0.1 contains not only the internal name (which is in there by default) but also the external address:
127.0.0.1 ec2-75-101-251-205.compute-1.amazonaws.com ec2-75-101-251-205 domU-12-31-38-01-B8-13.localdomain domU-12-31-38-01-B8-13 localhost localhost.localdomain
Now the server can be configured as usual by running kolab_bootstrap. Follow the instructions from the previous section now.
Kolab-Server <= 2.1.0
For all Kolab Server EC2 image versions less or equal than 2.1.0 you need to run
for bootstrapping the system. Other than that you will need to perform the steps described in Kolab-Server > 2.1.0 and Kolab-Server < 2.2.2 followed by the bootstrapping described in Kolab-Server >= 2.2.2.