This message here has the same purpose but now running on Ubuntu Servers and linked to an openldap server. I used 9.04 (Jaunty Jackalope), but I think there shouldn't be too much changes in earlier or later versions.
I used the following setup:
3 ejabberd nodes (ejabberd1, ejabberd2, and ejabberd3)
1 OpenLDAP Server
Installation and Configuration First ejabberd
Make sure that your are logged in as root user.
1. Install ejabberd:
$ apt-get install ejabberd
2. Configure ejabberd to get users from the openldap server
* adapt /etc/ejabberd/ejabberd.cfg:
** %% Admin user: in this example the user must be listed in the LDAP
** %% Hostname
** %% List of LDAP servers: {ldap_servers, [""]}.
--> make sure that ejabberd node can reach ldap server using its
hostname (possibly adapt /etc/hosts)
** %% Encryption .. LDAP Servers (LDAPS): {ldap_encrypt, }.
--> tls, ssl, none, ...
** %% Port connect to LDAP server: {ldap_port, }.
** %% LDAP Manager: {ldap_rootdn, ""}.
--> e.g. {ldap_rootdn, "cn=admin,dc=example,dc=com"}.
** %% Password of LDAP manager: {ldap_password, ""}.
** %% LDAP attribute that holds user ID: {ldap_uids, [{"uid", "%u"}]}.
3. Modify /usr/sbin/ejabberdctl:
ERLANG_NODE=ejabberd@`hostname`
--> not single quotes but back single quotes around hostname
4. Start ejabberd:
/etc/init.d/ejabberd start
Check if ejabberd is running:
$ ejabberdctl status
Node ejabberd@ejabberd1 is started. Status: started
ejabberd is running
Installation and Configuration Other ejabberd Nodes
1. Install ejabberd:
$ apt-get install ejabberd
2. Copy ejabberd.cfg from first node
3. Copy ejabberdctl from first node
4. Copy
/var/lib/ejabberd/.erlang.cookie
from node 1 to new node.5. Start ejabberd:
/etc/init.d/ejabberd start
Check if ejabberd is running:
$ ejabberdctl status
Node ejabberd@ejabberd2 is started. Status: started
ejabberd is running
Now synchronize the databases is the tricky part. Thanks to this blog it is a piece of cake.
Just perform the steps below to synchronize the database of node 2 with the first node:
1. Start ejabberd in debug mode:
$ ejabberdctl debug
You arrive in an Erlang shell.
2. Enter the following commands:
* FirstNode = 'ejabberd@first', %%where first is the hostname of the first node (!) Make sure that the line ends with a comma, indicating that there are other commands to follow
* mnesia:stop(),
* mnesia:delete_schema([node()]),
* mnesia:start(),
* mnesia:change_config(extra_db_nodes, [FirstNode]),
* mnesia:change_table_copy_type(schema, node(), disc_copies).
3. End the debug session by pressing Ctrl-c, Ctrl-c
Your second node now runs ejabberd with the same database as on the first node.
Repeat this procedure for other ejabberd nodes which must serve the same database.
Web Interface ejabberd
----------------------
By default there is a webinterface available for ejabberd on http://
Log on with an LDAP user who has been added to the list of Admin users in ejabberd.cfg, login name is in the format user@domain, e.g. admin@example.com