oreilly.comSafari Books Online.Conferences.
Articles Radar Books  

Installing the Jabber Server

by DJ Adams

This is Chapter 3 from O'Reilly's Programming Jabber, by D.J. Adams. In it, D.J. tells how to obtain, install, configure, and start up a Jabber server of your own with the minimum of fuss. D.J. also writes about Jabber for the O'Reilly Network, including a recent article on Jabber Chatbots. -- Ed.

It's certainly possible to learn about the Jabber protocols and technology and develop solutions using someone else's Jabber server, but for real understanding and control, it's definitely worth setting up one of your own. By installing and configuring a Jabber server, you will gain a valuable insight into how it and its components work together. Understanding how components are controlled and configured allows us to build Jabber solutions in the context of the "big picture."


Downloading the Jabber Server

Installing the Server

Configuring the Jabber Server

Starting and Stopping the Jabber Server

Monitoring and Troubleshooting the Server

Installations of earlier versions (1.0, 1.2) of the Jabber server were often complex affairs, and while the installation process has become much more straightforward, some people still shrink back from installing and configuring their own. This chapter shows how straightforward it is.

If you already have a server set up, you might want to skip this chapter and go on to Chapter 4, where the configuration and systcode architecture are explained in more detail.

Although the Jabber development platform is Linux, the Jabber server will compile and run on many flavors of Unix, including FreeBSD, Solaris, AIX, and IRIX.[1] Versions of the C compiler and make utility from the GNU project (at http://www.gnu.org) are recommended if you don't already have thcode installed.

The examples shown in this and other chapters are taken from Linux platforms (various Slackware and Red Hat distributions with 2.2 and 2.4 kernel versions); consult your local documentation for equivalent commands on your Unix OS.

The incarnation of the Jabber server at the time of writing is Version 1.4, more specifically 1.4.1. Version 1.4 represents a major advance in the server code and brings increases in performance and reliability over earlier versions. Jabber server Version 1.4.1 is the one we will obtain and install here, and this will be used as the server for the recipes in the rest of this book.

Downloading the Jabber Server

Related Reading

Programming JabberProgramming Jabber
By DJ Adams
Table of Contents
Full Description

The Jabber server package can be obtained from the Jabber project site, http://www.jabber.org; the 1.4.1 version is available in the downloads area:


The tarball jabber-1.4.1.tar.gz contains everything that you need to get a Jabber server up and running.[2] Previous versions of the Jabber server came in multiple packages; it was necessary to separately obtain and install GNU's portable threads library (pth) and the asynchronous DNS package (ADNS), as well as obtaining and installing various Jabber-specific libraries such as libxode, libjabber, and libetherx. Now some of these libraries and packages have become obsolete as far as the Jabber server is concerned (ADNS and libetherx) and others have been combined into the main Jabber server tarball.

If you don't want to compile the server yourself, you can also download prebuilt binaries for some of the platforms already mentioned, from http://download.jabber.org.

Installing the Server

Once you have downloaded the Jabber server tarball, you need to unpack it, configure the build environment, and compile the server. The general idea is that the Jabber server will be compiled and run from wherever you decide to unpack it; that is, there is no separate "install" step.

For this reason, and because it's also often useful to be able to install and start up a different version of the Jabber server for testing and comparisons, create a generic jabber directory somewhere central but local, for example in /usr/local/:

yak:/usr/local# mkdir jabber

The Jabber server does not need to be and should not be run as root; so create a new user jabber(group jabber) to be used as the Jabber server administrator and make that user the owner of the generic Jabber server directory:

yak:/usr/local# groupadd jabber
yak:/usr/local# useradd -g jabber -d /usr/local/jabber jabber
yak:/usr/local# passwd jabber
Changing password for jabber
Enter the new password (minimum of 5, maximum of 127 characters)
Please use a combination of upper and lower case letters and numbers.
New password: ********
Re-enter new password: ********
Password changed.
yak:/usr/local# chown jabber:jabber jabber

Once you've created the generic Jabber server directory, switch to the new Jabber server administration user jabber, unpack the tarball you downloaded, and enter the resulting directory:

yak:/usr/local# su - jabber
yak:~$ tar xzf jabber-1.4.1.tar.gz
yak:~$ cd jabber-1.4.1/

Running the Configure Server

Examining the contents of the jabber-1.4.1 directory, we see the following files:

  • configure (the configuration script)

  • jabber.xml (the server configuration file)

  • Makefile (for compiling the Jabber server)

  • README (some basic instructions)

  • UPGRADE (information on upgrading from an earlier server version)

as well as a number of directories that contain the source code.

The first step is to run the configure script:

yak:~/jabber-1.4.1$ ./configure

to determine your platform's compiler settings.

If you want SSL support in the Jabber server, run the script with the - -enable-ssl switch:

yak:~/jabber-1.4.1$ ./configure --enable-ssl

If you specified the - -enable-ssl switch, the configure script looks for your SSL installation and adds the appropriate compiler flags. If it doesn't find your SSL installation, it says so and your Jabber server is compiled withoutSSL support.

Next, it will try to determine whether you have pth installed and if so will use the pth-config command to glean the extra compiler options for building the Jabber server. pth is required, so if it isn'talready installed, it will be set up within your current jabber-1.4.1 directory tree (as pth is included in the jabber-1.4.1.tar.gz tarball) and the appropriate compiler options added.

If pth is set up during the course of running configure, you may see a message: "Now please type 'make' to compile. Good luck.", which comes at the end of the pth configure procedure; you can ignore this because there is only one make step, for the Jabber server, that must be carried out as we are merely preparing the pth build environment for binding into the Jabber Server build.

Finally, after extra platform-specific compiler settings are determined, a shell script to set the build environment variables is created with the name platform-settings. This is used in the next step.

Example 3-1 shows typical output from the configure script.

Example 3-1. Typical output from configure

Running Jabber Configure

Getting pth settings...         Done.
Setting Build Parameters...     Done.
Generating Settings Script...   Done.

You may now type 'make' to build your new Jabber systcode.

Pages: 1, 2, 3, 4

Next Pagearrow

P2P Weblogs

Richard Koman Richard Koman's Weblog
Supreme Court Decides Unanimously Against Grokster
Updating as we go. Supremes have ruled 9-0 in favor of the studios in MGM v Grokster. But does the decision have wider import? Is it a death knell for tech? It's starting to look like the answer is no. (Jun 27, 2005)

> More from O'Reilly Developer Weblogs

More Weblogs
FolderShare remote computer search: better privacy than Google Desktop? [Sid Steward]

Data Condoms: Solutions for Private, Remote Search Indexes [Sid Steward]

Behold! Google the darknet/p2p search engine! [Sid Steward]

Open Source & The Fallacy Of Composition [Spencer Critchley]