Installing ejabberd

From OLPC
Revision as of 18:57, 27 March 2008 by Morgs (talk | contribs) (Make Fedora 7 rpm info more prominent)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


Packages

A Fedora 7 RPM for ejabberd with the OLPC patches is available from the school server repositories - install that and proceed from step 7 below for configuration.

Otherwise, see installing from source:

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.

If running on Fedora 7, you can skip steps 1 - 6 and just download the RPM from the school server repositories

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. There are two ways to add the user jtest (as specified above in point 7):

(a) Use a jabber client to register the user jtest on your.server.name. This is useful if you want to be logged in to the server with a regular jabber client and see the participants in the shared roster. Note: You need to register the account - for example, in pidgin, check the "Create this new account on the server" option.

or

(b) sudo ejabberdctl register jtest your.host.name password (replace password with an actual password...)

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 "Online" and click Add New.

12. Click on "Online" and enter "Online" for Name, "@online@" for Members, and "Online" for Displayed Groups. Click Submit.

It should be working now!

13. In your jabber client, disconnect and reconnect the "jtest@your.host.name" account to activate seeing the shared roster group. Note that you will only see it in your buddy list when other users connect (XOs or jabber clients) - an empty group is not shown.

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!