Installing ejabberd

From OLPC
Revision as of 10:15, 6 March 2008 by 72.92.232.136 (talk)
Jump to: navigation, search


Installing ejabberd from source with OLPC patches

Originally posted here

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.

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 the examples with the appropriate hostname.

1. Don’t have ejabberd installed from the Ubuntu archives - we will build it from source. You will have to enable the "universe" package repositories.

2. Install dependencies:

sudo apt-get install erlang-base erlang-nox erlang-dev build-essential libssl-dev libexpat-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:

sudo ejabberdctl start
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.--morgs 08:49, 4 March 2008 (EST)

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.--morgs 08:49, 4 March 2008 (EST))

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!