WebReference.com - Part 2 of Chapter 3 from Programming Jabber, O'Reilly & Associates (1/4) | WebReference

WebReference.com - Part 2 of Chapter 3 from Programming Jabber, O'Reilly & Associates (1/4)

current pageTo page 2To page 3

Programming Jabber

Starting and Stopping the Jabber Server

[The following is the conclusion of our series of excerpts from chapter 3 of the O'Reilly title, Programming Jabber.]

At this stage, we have a Jabber server with enough basic configuration to be able to start it up and have it do something useful (like accept client connections). If you're curious about the rest of the configuration you encountered while editing the jabber.xml file, you can jump to Chapter 4. Otherwise, let's start it up!

Starting the Server

The basic invocation looks like this:

yak:~/jabber-1.4.1$ ./jabberd/jabberd

but if you haven't bothered to change localhost anywhere in the configuration (as described earlier), you can use the -h switch to specify the hostname:

yak:~/jabber-1.4.1$ ./jabberd/jabberd -h yak

As it stands, there's a directive in the standard jabber.xml configuration file that specifies that any server error messages are to be written out to STDERR:

<log id='elogger'>
  <format>%d: [%t] (%h): %s</format>

So either comment the directive out:


Or redirect STDERR to /dev/null:

yak:~/jabber-1.4.1$ ./jabberd/jabberd -h yak 2>/dev/null

You won't lose the error messages -- as you can see they're also written to the error.log file.

Assuming you wish to free up the terminal session after starting the server, you can send it to the background:

yak:~/jabber-1.4.1$ ./jabberd/jabberd -h yak 2>/dev/null &

Connecting a Client

Once the server is started, you're ready to start up a client and make a connection. The thing to remember at this point, when specifying which server to connect to, is to use the same hostname as you specified in the <host/> part of the configuration, described earlier in "Configuring the Jabber Server."

NOTE: If your client supports the <alias/> mechanism, described in the section "Customer Configuration" in Chapter 4, this may not be necessary.

current pageTo page 2To page 3

Created: January 22, 2002
Revised: January 22, 2002

URL: http://webreference.com/programming/jabber/chap3/2/