Installing the Jabber Serverby 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."
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.
Versions of the C compiler and
from the GNU project (at
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.
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:
jabber-1.4.1.tar.gz contains everything
that you need to get a Jabber server up and running.
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
libetherx. Now some
of these libraries and packages have become obsolete as far as the Jabber
server is concerned (
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.
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
yak:/usr/local# mkdir jabber
The Jabber server does not need to be and should not be run as
so create a new user
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 yak:/usr/local#
Once you've created the generic Jabber server directory, switch to the new
Jabber server administration user
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/ yak:~/jabber-1.4.1$
Running the Configure Server
Examining the contents of the
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
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
Next, it will try to determine whether you have
installed and if so will use the
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
pth is included in the
jabber-1.4.1.tar.gz tarball) and the appropriate compiler
pth is set up during the course of
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
for the Jabber server, that must be carried out as we are merely preparing
pth build environment for binding into the Jabber
Finally, after extra platform-specific compiler settings are determined,
a shell script to set the build environment variables is created with the
platform-settings. This is used in the next step.
Example 3-1 shows typical output from the
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.