7. Configuring a Jabber Server

XMPP (earlier known as jabber) stands for Extensible Messaging and Presence Protocol and is an open, XML-based protocol originally aimed at near-real-time, extensible instant messaging and presence information.

A Jabber server is configured in several steps:

Installing the Jabber service onto your system

The Jabber service, configurable with the calculate-server package, requires that LDAP be available. If this is not the case, install it by running:

cl-setup ldap

To install the Jabber service itself, execute:

cl-setup jabber

The service will be installed then with default settings: the service hostname will be the same as the machine hostname and service will not log users' messages.

To enable such logging, enter instead:

cl-setup --history on jabber

To specify addition Jabber host (e.i. jabber.myhost.ru), use the --hosts option:

cl-setup --hosts jabber.myhost.ru jabber

Messages will be stored in the /var/log/jabber directory.

When installing, the service will require a password for the account admin.

Accounts

Each user in the network has his unique identifier, his Jabber ID (JID). A JID address, like an e-mail address, contains the username and the server domain name, separated by a "@". For instance, if a user named user were registered on the domain server example.com, their JID address would be .

Managing accounts

Add an account

To add an account on the Jabber server, use_cl-useradd_:

# add the user "guest@domain" with the nickname "Guest" 
cl-useradd -p -c "Guest" guest jabber
# add the user "guest@domain" with the nickname "Guest", and load a photo of them
cl-useradd -p -c "Guest" -i pic/guest.png guest jabber

Supported image formats are defined by Image_Magic capabilities. If you do not have it on the system, only one format, .jpeg, will be available.

Change the password

To changing the password of a Jabber account, use_cl-passwd_:

cl-passwd guest jabber

Lock or delete an account

If you want to delete an account from Jabber, user the cl-userdel command:

cl-userdel guest jabber

If you just want to lock an account, user_cl-usermod -L_:

cl-usermod -L guest jabber

You can unlock with cl-usermod -U:

cl-usermod -U guest jabber

Groups

A group is set of JIDs used to mail messages to multiple users simultaneously. When a user connects to the Jabber service, they will automatically receive a list of groups and their members. Visitors without a group on your contact list should be added manually. A user can belong to only one group.

Managing groups

Create a group

Creating a Jabber group is done with the cl-groupadd command:

# Create a group named "Test group" 
cl-groupadd "Test group" jabber

The group name will be displayed to all users on the contact list.

Delete a group

To remove a group from Jabber, use cl-groupdel:

# delete "Test group" 
cl-groupdel "Test group" jabber

Only the group will be removed, all users who have been included in this group will remain, but will belong to no group from now on.

Rename a group

To rename a group, use the cl-groupmod command:

# set the new name "Renamed group" to the group "My test" 
cl-groupmod -n "Renamed group" "My test" jabber

Change group members

To change group members, use cl-groupmod and cl-usermod:

# Put the "guest" user in the group "Guest group" 
cl-usermod -g "Guest group" guest jabber
# remove "guest" from "Guest group" 
cl-groupmod -d guest "Guest group" jabber
# add two users, "guest' and "guest2" to "Guest group" 
cl-groupmod -a guest,guest2 "Guest group" jabber

Limitations

If your server has more than one network interface, and you want it to work in only one of them, put the directive (ip, (xxx, xxx, xxx, xxx)) in its configuration file, in the "listen" section. Attention, IP blocks are separated by commas!

{5223, ejabberd_c2s, [
                       {access, c2s},
                       {shaper, c2s_shaper},
                       {ip, {192, 168, 1, 6}},
                       {certfile, "/etc/jabber/ssl.pem"}, tls,
                       {max_stanza_size, 65536}
                     ]},

Consequently, this directive can be set for all ejabberd services: ejabberd_s2s, ejabberd_http, etc.

Thank you!