Configuring (basic) XMPP services using ejabberd on Fedora 15

Category: Software and Systems Engineering
Author: Sean O'Donnell
Tue, Sep. 11th, 2012 @ 18:51:08 (MDT)

I recently set-up an XMPP service for internal Instant Messaging Services for the team that I’m currently working with, so that we could get even less exercise around the office by simply sending instant messages, rather than walking over to each other’s desks. It’s a great time saver, but not a very healthy line of communications, like most of these lines of communication that we’ve grown to take for granted.

yum -y install ejabberd
ejabberdctl start

For the most part, the default configuration in Fedora 15, handles the basic (non-encrypted) configuration needs of most isolated IM systems. The ‘register’ function is disabled, but can be enabled (line: 165), if you wish to allow anyone to register via their IM client.

If you don’t want to allow users to register themselves, you can create accounts manually, from the command-line.

ejabberdctl register myusername mydomainname mypassword

Also, you should enable the default ‘admin’ Access Control List (ACL) settings for your desired admin user.

{acl, admin, {user, "myusername", "mydomainname"}}

This will allow the user ‘myusername’ to perform remote administration commands via his IM client, if they are available.

ejabberdctl restart

Unfortunately, there are no ‘/etc/init.d/*’ scripts available for the ejabberd package on Fedora 15 (or higher), so you will have to create your own, if you wish to keep the service running after rebooting.

#!/bin/bash
#
# /etc/rc.d/init.d/ejabberd
#
# This is a custom ejabberd init script written 
# for the Fedora Linux distribution, and is not 
# included by the ejabberd RPM package(s).
#
# author: Sean O'Donnell 
#
# chkconfig: - 99 10
# description: ejabberd XMPP server

# Source function library.
./etc/init.d/functions

set -o errexit

start()
{      
        echo -n "Starting : "
        /usr/sbin/ejabberdctl start
        return
}

status()
{
        echo -n "Starting : "
        /usr/sbin/ejabberdctl status
        return
}

stop() 
{
        echo -n "Shutting down : "
        /usr/sbin/ejabberdctl stop
        return
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    status)
        status
        ;;
    restart)
        stop
        start
        ;;
    *) 
        echo "Usage:  [start|stop|restart|status]"
        exit 1
        ;;
esac
exit $?

You can then configure systemctl to enable and start the service.

systemctl enable ejabberd.service
systemctl restart ejabberd.service

Copyleft (<) 1998-2019 www.seanodonnell.com