Quick and Dirty How-To for Ejabberd on Ubuntu

I Originally posted this in response to a forum on the Ubuntu forums.

--

I recently decided to tackle the task of serving a jabber daemon, having recently switched to Ubuntu Breezy after years of wandering among Fedora, Debian, and Slackware..

Ubuntu has mostly been great about working out-of-the-box for me, with a few unsurprising exceptions.

Ejabberd has more recommendations that I can find, as it will do encryption and web-based administration. I installed it a couple of days ago after trying jabberd briefly.

It works with only a couple of hacks, you need to go into the /etc/ejabberd/ejabberd.cfg and put your hostname in where it tells you in the comments, comme ca:

% Host(s) name: (replace for your hostname(s))
% Old {host, "localhost"}. option is equivalent to {hosts, ["localhost"]}.
{hosts, ["gps"]}.

My server is called gps. You'll also want to sudo and use "ejabberdctl register" to make yourself an account which you'll add into the same file for admin access.

% Users that have admin access. Add line like one of the following after you
% will be successfully registered on server to get admin access:
{acl, admin, {user, "g"}}.

Gotta love the one-character login, I use it whenever I can.

Once this is done issue the command:

sudo /etc/init.d/ejabberd restart

and to double-check it's running:

sudo ejabberdctl status

Then fire up your favorite web browser and point it to
http://192.168.0.2:5280/admin/
replacing 192.168.0.2 with the IP or hostname of your new ejabberd server. For username, enter "user@server" where user is the account you made earlier with ejabberdctl and server is the hostname you inserted into the ejabberdctl.cfg file. Hopefully you still remember the password you set from earlier.

In the web admin panel you can set access controls and add users, it doesn't look like you can add modules from here though. There's also a nodes page which is probably part of the fault-tolerance/rollover mechanism. I don't have another server to test this aspect yet, maybe I will investigate and write further later.

The biggest bugaboo I encountered, though, was getting GAIM 1.5.0 to connect ... After a bunch of tries, I found that the only way to make it work was an account set up like this:

change protocol to Jabber
screen name is user from before
server is the hostname from ejabberdctl.cfg
resource can be anything
password from before
alias is probably the name that shows up when you type a message
(open "show more options")
check BOTH TLS and SSL
port 5223
Connect server is IP or FQDN of your ejabberd server
No Proxy, unless you know that you need it.

Of course, now that you have the right settings you can actually just register a user from GAIM (unless you changed the acl already)... It's nice to know how to do it from the command line though.

To add a buddy, make sure to do the full "user@server" formula, mine is g@gps ..

Another Ubuntu / Debian Howto

We've noted down the steps we followed to get ejabberd working on an Ubuntu Gutsy Gibbon server

http://sysmonblog.co.uk/?p=11

much the same as above, although also covers what you need to do to re-build the ssl certificate (which otherwise Adium, on Mac OS X complains about when trying to connect).

and some notes about what the client configuration needs to be.

Syndicate content