I think finally it is the right time now, to setup the server for XMPP chat after having a deep dive into the stanzas.

Moving forward let me explain you the Installation Steps for Ubuntu.

There are quite a few servers available to choose from, I chose ejabberd for our application. Following  are some of the simple steps I’ll be taking you through, to install ejabberd:

Step 1:

sudo apt-get install ejabberd

Step 2:

Configuring the ejabberd config file:

Edit the config file (use any of your favorite editors):

[sudo] vim /etc/ejabberd/ejabberd.cfg

Edit the following line in the file:

  • %% Hostname {hosts, [“localhost”]}.

Replace localhost with the DNS hostname or IP address if configuring on a remote server like EC2.If testing on a local server, leave it as it is

For Example: %% Hostname {hosts, [“1.2.3.4″,”localhost”]}.

  •  Register an admin user for the server.

Edit:  %% Admin user {acl, admin, {user, “username”, “hostname”}}.

Replace “username” with the username of your choice and “hostname” with hostname you entered in the above step

Step 3:

Restart the server

[sudo] service ejabberd restart

Step 4:

Create the admin account.

Run the below command, replacing “admin” with the username, “localhost” with the hostname you edited in the file above

sudo ejabberdctl register admin localhost password

Step 5:

Go to, https://hostname:5280/admin

Enter the username and password. If all goes well you will find yourself with this page.

The server has been setup.

We will be customizing the server a bit more, when building our application in the next blog.

Related Blogs:

XMPP for Dummies – Creating Your Own Chat Application from Scratch – Part1

XMPP for dummies – Part 2 – A 4 Step Life Cycle to Create Your Own Chatter!

XMPP for Dummies- Part 3- Stanzas in Detail

XMPP for Dummies- Part 4- Diving Deep into Stanzas