Sunday, June 19, 2011

EC2 and ejabberd

After attempting various flavours of setup, I finally managed to spin up an EC2 instance and get ejabberd working on it this evening.

Things to note:
* use the 64-bit recommended micro AMI. (ami-45cefa31 : it's CentOs, but you'll manage).
* download the latest ejabberd in binary form from process-one.net:


$ cd ~
$ mkdir jabber
$ cd jabber
$ wget http://www.process-one.net/downloads/ejabberd/2.1.8/ejabberd-2.1.8-linux-x86_64-installer.bin.gz 
$ gunzip ejabberd-2.1.8-linux-x86_64-installer.bin.gz
$ chmod +x ejabberd-2.1.8-linux-x86_64-installer.bin
$ ./ejabberd-2.1.8-linux-x86-installer.bin


* do everything as ec2-user - don't sudo anywhere.
* check the service is stopped:

$ ~/ejabberd-2.1.8/bin/ejabberdctl status


* ensure you add "localhost", the instance short hostname and the instance full external DNS name to the list of hosts. Search for the "hosts" stanza in the config file.

$ nano ~/ejabberd-2.1.8/conf/ejabberd.cfg
* don't forget to open up ports 22, 5280, 5269 and 5222 on your security group.

If you spot any errors during installation, or ejabberdctl status gives strange results or failures, then something bad has happened - wipe the image and start again.

So after a good few hours of tail-chasing and examining inscrutible Erlang logs, the devious plan of wiping the instance and starting again each time things went south eventually worked! I can now chat using Jabber to my EC2 instance, and our cunning plans move another pace forward. Excellent!

No comments:

Post a Comment