Setting up your own cross platform chat server
Posted by Steve on Tue 9 Nov 2004 at 18:07
root@undecided:~# apt-get install jabberThis 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.flatNow 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 gabberThen 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.flatAll 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.
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 | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | 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 | Reply to this comment ]
JABBER_HOSTNAME=domain1.tld
JABBER_HOSTNAME=domain2.tld
does not work
Any Ideas ?
[ Parent | Reply to this comment ]
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 | Reply to this comment ]
Seems that the default setup doesn't work with chat rooms.
thanks
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
This would be an open server.
How can I setup different groups and so on?
[ Parent | Reply to this comment ]