This site is now 100% read-only, and retired.

Setting up your own cross platform chat server

Posted by Steve on Tue 9 Nov 2004 at 18:07

Jabber is an XML based cross platform chat and messenging server which is freely available. It runs on Linux, Solaris, and many other Unix variants. For a small office or a collection of offices it's a great way to allow people to chat without resorting to outside services such as MSN. This small guide gives a quick walk through of installing a server and setting up your first client on a Debian Unstable machine. Debian stable is handled almost identically, although the clients aren't available for it. Running the server itself on a stable machine isn't any different. The first thing to do is download and install the server:
root@undecided:~# apt-get install jabber
This will download and install jabber, jabber-common and any other packages your system might need. The server will be started automatically at this point, so we need to stop it and update the configuration to work with your host. To stop the server run:
root@undecided:~# /etc/init.d/jabber stop
Stopping jabberd: jabberd.
Now we can look at the configuration files inside the directory /etc/jabber. The main thing that we need to setup is the hostname directive. The server itself is primarily configured via the XML file /etc/jabber/jabber.xml, but as a convience the startup script of the Debian package will make use of the file jabber.cfg as well, and this is where we'll set the name up. In a small office where you have your own DNS system it is useful to setup a hostname to refer to the system, this allows you to move machines without having to change any clients. I've used chat.my.company before for this purpse. In this case I'm just using the hostname of the current machine. So edit the file /etc/jabber/jabber.cfg to have your hostname:
# JABBER_HOSTNAME (which is then passed to jabberd in the -h switch)
JABBER_HOSTNAME=undecided.my.flat
Now we can start the server up:
root@undecided:~# /etc/init.d/jabber start
Starting jabberd: jabberd.
Connecting to the server involves downloading and installing a chat client. My favorite client is gabber for Linux, and Exodus for Windows. Other clients exist packaged for Debian including PSI. To install gabber, on a client machine, run:
apt-get install gabber
Then once it's installed you will be shown a connection dialog. This has space for a username, a password, and a server name. Enter the username and password you wish to use and the name of the server you already setup. (In my case thats undecided.my.flat). Once you click the connect button you will see the following error message:
Gabber could not log you in.
Would you like Gabber to try to create a new 
account on the selected Jabber server?
Click 'Yes' and your account will be created. You will then see the main contact window which should show that you have received a new message from the server saying 'Welcome'. If you now move to another machine you can repeat the process to add another user. Finally you can add the users to each others contact list, called a roster in Jabber-speak. Click on the Actions menu and select Add Contact. Then choose Add this JabberID. Type in the ID of the user you wish to add in, remembering to add the hostname. For example:
steve@undecided.my.flat
All Jabber contacts have the form username@hostname - just like an email address, even though it isnt! Once the other person logs in and approves the addition you will be able to chat to them! The roster lists are all maintained upon the server side, in a directory beneath /var/lib/jabber named after the servers hostname. If you examine one of the ones you've created already you will see there is a section at the start for the username and password and some global options and then at the end there is a section at the end for the contacts. With a bit of scripting you can generate these files for all your users yourself and add each other to their groups, but that's a writeup for another day.

 

 


Re: Setting up your own cross platform chat server
Posted by davee (127.0.xx.xx) on Wed 15 Dec 2004 at 15:09

If you examine one of the ones you've created already you will see there is a section at the start for the username and password and some global options and then at the end there is a section at the end for the contacts. With a bit of scripting you can generate these files for all your users yourself and add each other to their groups, but that's a writeup for another day.

Have you actually done this? I tried and found that the HASH values in the middle of those files made it impossible to do what you suggest, since you can't script generation of the hashes.

[ Parent ]

Re: Setting up your own cross platform chat server
Posted by davee (127.0.xx.xx) on Wed 15 Dec 2004 at 15:31
Sorry, I'm talking rubbish :-) The version I am describing above is a custom compiled version. The Debian package in Sarge does not introduce hash values, meaning that one could script the generation of the profiles. Move along, nothing to see ... :-)

[ Parent ]

Re: Setting up your own cross platform chat server
Posted by Steve (127.0.xx.xx) on Wed 15 Dec 2004 at 15:54
[ View Weblogs ]

The only issue I found is that depending on the client you use to setup the initial account you might find the password is encrypted.

I found it was obvious how to undo this though changing it to remove the encrypted attribute, and then putting the password in as plain text.

Steve
-- Steve.org.uk

[ Parent ]

Re: Setting up your own cross platform chat server
Posted by Anonymous (160.83.xx.xx) on Thu 4 May 2006 at 20:18
Does anybody know how to setup Jabber server running on multiple domains?

JABBER_HOSTNAME=domain1.tld

JABBER_HOSTNAME=domain2.tld

does not work


Any Ideas ?

[ Parent ]

Re: Setting up your own cross platform chat server
Posted by Anonymous (193.2.xx.xx) on Wed 24 May 2006 at 07:46
Excerpt from jabber.xml:

Multiple entries are allowed - each one is for a
separate virtual server. Note that each host entry must
be on one line, the server doesn't like it otherwise! :)
Use lowercase for the hostname.

[ Parent ]

Re: Setting up your own cross platform chat server
Posted by Anonymous (212.131.xx.xx) on Thu 22 Feb 2007 at 16:17
Anyone know how to configure jabberd to have users that can join on chat rooms?
Seems that the default setup doesn't work with chat rooms.

thanks

[ Parent ]

Re: Setting up your own cross platform chat server
Posted by Anonymous (194.63.xx.xx) on Tue 13 Nov 2007 at 10:06
You need to install mu-conference as well. It's the package jabber-muc in Debian. I haven't found how to make it work yet, though..

[ Parent ]

Re: Setting up your own cross platform chat server
Posted by Anonymous (217.226.xx.xx) on Fri 27 Apr 2007 at 21:02
But what about setting passwords?
This would be an open server.
How can I setup different groups and so on?

[ Parent ]