Configuring XMPP with Assembla
This document describes the minimum you should do to make ejabberd working with Assembla Breakout.
Get the erlang/OTP (http://erlang.org).
Get the ejabberd (ejabberd.jabber.ru) and ruby_ldapd (http://tools.assembla.com/xmpp_integration). If your ejabberd version is prior to 1.1.4, you will need to get src/eldap/eldap.erl from svn and replace your local copy with it.
After you've unpacked ejabberd and checked out ruby_ldapd, you need to copy mod_shared_roster_ldap.erl from ruby_ldapd/contrib/ejabberd to ejabberd/src/
mod_shared_roster_ldap - is modified so that you can have per-user groups, getting the same file from other source will not work with this setup.
Now you can follow the usual process of building something with configure, make. configure accepts --prefix flag and, also, make do accept the DESTDIR option. So, to install to the specific directory you can do:
sh configure --prefix=/home/jabber/ejabberd && make && make install
Setting up the ejabberd runtime environment
1. Create a directory, for example /home/jabber/ejabberd-run - this directory will hold your ejabberd configuration and mnesia database. Copy ejabberd.cfg from ruby_ldapd/contrib/ to your runtime directory
2. Change hostname ejabber will serve. This is "hosts" option
3. Change the ldap manager password. This is ldap_password option
4. Generate SSL certificate
## Be sure to enter the FQDN of your Jabber server as the «Common Name»
openssl req -new -x509 -newkey rsa:1024 -days 3650 -keyout privkey.pem -out key.pem
## This will remove the passphrase
openssl rsa -in privkey.pem -out privkey.pem
## Put it all together
cat privkey.pem >> key.pem
## Cleanup
rm privkey.pem
5. Change ejabberd.cfg so that it will use your SSL key
Setting up ruby_ldapd
The database configuration is the same as for any rails application - config/database.yml. You may also look into config/ldap_conf.yml and change the dirmgr's password if you've changed it in the ejabberd.cfg.
Running ruby_ldapd and ejabberd
To run ldap server, you need to start ruby_ldapd.rb, so, for example:
cd /
nohup ruby ruby_ldap.rb &
To run ejabberd:
cd to your ejabberd runtime and execute:
erl -pa /home/jabber/ejabberd/var/lib/ejabberd/ebin -sname ejabberd -s ejabberd
the -pa flag should point to the ebin directory of you ejabberd installation.
This is it. For the more options, please refer to the ejabberd manual.
Setting up http-polling
Suppose you have ejabberd with http-polling enabled on http://chat.assembla.com:5280 and JS XMPP client on assembla.com.
You will need to configure your web-server to forward requests to https://assembla.com/http-poll to the http://chat.assembla.com:5280/http-poll.
WithIf Apache,you yourhave Apache this can dobe thisdone withas mod_rewrite,the for example:following:
RewriteEngine on
RewriteRule /http-poll/ http://chat.assembla.com:5280/http-poll/ [P]
RewriteRule /http-poll http://chat.assembla.com:5280/http-poll/ [P]
Do not forget to enable SSL in the Apache.SSL.