OLPC community Jabber servers: ejabberd 2.0.0 from source

Update: Added these instructions to the OLPC wiki: http://wiki.laptop.org/go/Installing_ejabberd

Update: No more need to build from source, if you’re running Intrepid which has the required patches for ejabberd!

Here’s a walkthrough of installing ejabberd 2.0.0 (freshly released) from source, with the OLPC patches, on Ubuntu 7.10. It’s based on the wikipage [[Ejabberd Configuration]] with more detail.

In the near future I’ll post about prebuilt packages – they are currently out of date.

A bit about my setup: I’m installing ejabberd on my laptop running Ubuntu. I have two XOs connected to my wireless access point. My dhcp and dns doesn’t give a fully qualified domain name to my laptop, so I’m putting its IP address and “your.host.name” into /etc/hosts on all the machines.

To run ejabberd as a public server, you will need to run it on a public server where you have root privileges – like a Xen hosted virtual server. Replace “your.host.name” in my examples with the appropriate hostname.

Let’s dive into the installation… Some of the commands displayed below might be chopped off. You can still copy and paste them to see the full command.

1. Don’t have ejabberd installed from the Ubuntu archives – we will build it from source.

2. Install dependencies:

sudo apt-get install erlang-base erlang-nox erlang-dev build-essential libssl-dev

3. Get the ejabberd source:

mkdir ejabberd
cd ejabberd
wget http://www.process-one.net/downloads/ejabberd/2.0.0/ejabberd-2.0.0.tar.gz
tar xfz ejabberd-2.0.0.tar.gz

4. Get and apply the OLPC-specific patches and configuration:

wget http://people.collabora.co.uk/~robot101/olpc-ejabberd/shared_roster_push2.diff
wget http://people.collabora.co.uk/~robot101/olpc-ejabberd/shared_roster_recent.diff
wget http://people.collabora.co.uk/~robot101/olpc-ejabberd/shared_roster_online.diff
wget http://people.collabora.co.uk/~robot101/olpc-ejabberd/mod_ctlextra.diff
wget http://people.collabora.co.uk/~robot101/olpc-ejabberd/ejabberd.cfg
cd ejabberd-2.0.0/
patch -p1 < ../shared_roster_push2.diff
patch -p1 < ../shared_roster_recent.diff
patch -p1 < ../shared_roster_online.diff
patch -p1 < ../mod_ctlextra.diff

5. Build ejabberd:

cd src
./configure
make

(Although I saw “warning: pointer targets in assignment differ in signedness” at this point, the build did succeed.)

6. Install:

sudo make install

7. Apply configuration:

cd ../..
sudo cp ejabberd.cfg /etc/ejabberd/
sudo gedit /etc/ejabberd/ejabberd.cfg

(or use your preferred editor.)

Change the hostname: find the line that says

{hosts, ["jabber.laptop.org"]}.

and set it to the FQDN of your server:

{hosts, ["your.server.name"]}.

Do the same for the admin login: find the line that says

{acl, admin, {user, "jtest", "jabber.laptop.org"}}.

and set the FQDN to your server:

{acl, admin, {user, "jtest", "your.server.name"}}.

(The username “jtest” is for admin rights accessing the web interface. You can change it to something else, but keep it consistent.)

8. Start the server. You should be able to use sudo /etc/init.d/ejabberd start, but that didn’t work for me (yet). This will do it, but won’t start automatically on boot:

sudo ejabberdctl start

9. To set up the shared roster we need a user who can log in through the web interface. Use a jabber client to register the user jtest on your.server.name – you need to do this to have an admin user in the web interface.

10. Go to http://your.server.name:5280/admin/ and login as “jtest@your.server.name” with the password you set when registering.

11. Click on “Virtual Hosts”, then your hostname, then “Shared Roster Groups”. Type “everybody” and click Add New.

12. Click on “everybody” and enter “everybody” for Name, “@online@” for Members, and “everybody” for Displayed Groups. Click Submit. (I tried some variations on these names, per [[Ejabberd Configuration]] and http://www.ejabberd.im/shared-roster-all but these exact strings were the only combination that worked for me.)

It should be working now!

13. In your jabber client, disconnect and reconnect the “jtest@your.host.name” account.

14. On an XO, go to the Terminal and type “sugar-control-panel -s jabber your.host.name”. Restart sugar with ctrl-alt-erase.

15. In your jabber client (with the jtest account) you should see a new group appear called everybody, showing the nickname of the XO.

You can now get multiple XOs, emulated XOs or sugar-jhbuild instances connected and collaborating!

About these ads

16 Responses to “OLPC community Jabber servers: ejabberd 2.0.0 from source”


  1. 1 Harper March 2, 2008 at 1:06 am

    Just followed your tutorial. Nice work. I ran into some gotchas trying to get the collabora ejabberd config file working. I figured out that it is configured to use ipv6 – so if your server is not able to use ipv6 or isn’t configured correctly, ejabberd will just fail and not spawn the listening ports.

    However – you can easily remove the inet6 lines from the given config file to solve the problem.

    Chicago OLPC group jabber server at jabber.olpchacks.org

    Thanks,
    Harper

  2. 2 BrianE March 4, 2008 at 4:38 am

    I’ve followed the steps and ejabberd is up and running. I can connect to it from various jabber clients but the the xo i’m testing with does not show up. I got my xo connected to jabber.olpchacks.org so I’m pretty sure its not an xo thing. Any ideas?

  3. 3 Morgan March 4, 2008 at 2:12 pm

    BrianE: I’m happy to help but that’s not enough information. Contact me (details on /about/ on this site) and we can debug.

  4. 4 kawk March 6, 2008 at 2:49 am

    I’m having some troubles with this – I can set up everything, but my Jabber client doesn’t see the “everybody” group.

    Suggestions?

  5. 5 kawk March 6, 2008 at 2:54 am

    Scratch that – I can see the Sugar user, but not the group “everybody”.

  6. 7 Morgan March 6, 2008 at 8:16 am

    To make it clearer: I’ve put these instructions on the OLPC wiki: http://wiki.laptop.org/go/Installing_ejabberd – see that page for any updates.

  7. 8 Mohamed Zaian April 7, 2008 at 7:32 am

    hey guys i installed ejabberd form source code it’s fine working for me and also the shared roster are working fine i’m running it under Ubuntu Gutsy, but i have a question, which chat server can allow me to let users do voice & video conferences? what is the requirements for it please anyone let me know or email me & i would be thankful

  8. 9 Morgan April 7, 2008 at 7:42 am

    Mohamed, as far as I know there are no special requirements on the server for video/voice. In OLPC land though we don’t have working clients for video/VoIP yet.

  9. 10 Mohamed Zaian April 7, 2008 at 9:27 am

    so all you need is a CLIENT? i tried “Spark” it’s a java client for xmpp it works fine but no audio/video options i think it’s related to the server i tried to connect by “wengophone” but it seems it doesn’t support XMPP servers it’s only for SIP, so i think it’s not a client problem it’s related to the server see “http://www.gizmo5.com” they are using ejabberd thier client support audio & video they maintained ejabberd to do that or i don’t know really but i really need to know how can i ..

  10. 11 Morgan April 7, 2008 at 9:37 am

    Mohamed, Empathy (http://live.gnome.org/Empathy) is an XMPP client that uses the Telepathy (http://telepathy.freedesktop.org/wiki/) stack. It has support for voice and perhaps video too, although it’s still not completely stable so it’s not enabled by default in distro packages. If you build Empathy yourself you can enable the VoIP functionality which uses XMPP, not SIP.

    If you have irc, connect to #telepathy on freenode to chat to the developers, otherwise see the Telepathy site for more.

  11. 12 Alex Keybl April 26, 2008 at 12:55 am

    Hi there Morgan. I’m working on setting up a jabber server for a pilot program we’ll be running in September in North Carolina. I’ve followed your instructions, and can connect to the jabber server with the account jtest, but not using any of the XO laptops (or emulated images for that matter).

    The log only reads:
    =INFO REPORT==== 2008-04-25 20:49:58 ===
    I(:ejabberd_listener:112) : (#Port) Accepted connection {{0,0,0,0,0,65535,38915,10457},52845} -> {{0,0
    ,0,0,0,65535,38915,20286},5223}

    When an XO tries to connect, it never registers a new user, or accepts authentication, or opens a session. I get the same behavior when trying to register a new user on the server through Adium. Any thoughts? Thanks in advance.

  12. 13 heru priadi July 14, 2010 at 5:08 am

    thanks for ur tutorial :)


  1. 1 OLPC community Jabber servers « Feeding the Penguins Trackback on February 28, 2008 at 8:42 am
  2. 2 OLPC Chicago Jabber Server » Harper Reed: Tech, Phones, Yo-yoing and Death Metal Trackback on March 2, 2008 at 7:54 am
  3. 3 Sugar/OLPC jabber server with Ubuntu Intrepid « Feeding the Penguins Trackback on October 24, 2008 at 2:24 pm
Comments are currently closed.




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: