LJ Archive

Chatting Up the Chef

Marcel Gagné

Issue #107, March 2003

Introducing two chat servers, geektalkd and Shadowlands Forum, and a fine Jabber instant-messaging client.

Everything looks wonderful, François. Candles on every table, wineglasses, workstations, DSL feeds—we are ready. Tonight's menu is a toast, if you will, to this issue's theme of On-line Fora. Every item is designed to bring people closer together, even if in a virtual fashion, non? Perhaps we should serve a somewhat romantic wine; the 1997 Alsatian Gewurztraminer sounds right for this evening. You don't agree, mon ami? Well, perhaps romantic is a bit much, but consider this, human interaction, even on-line, is all about communication, and communication implies a certain closeness—even if you don't like the person, non?

Quoi? Well, it is all very simple, François. The whole idea of people communicating with other people is at the heart of the Internet's existence—whether it is a web page trying to sell a product or a colleague sending an e-mail. When we cook with Linux, we can take advantage of those communication possibilities in many different ways.

Ah, but our guests have arrived! Bonsoir, mes amis. Welcome to Chez Marcel, home of fine Linux fare and most excellent wine, non? Your tables are ready. Please, be seated. My faithful waiter will serve the wine.

On-line fora exist in a number of incarnations, mes amis, from web portals, to intranets, to chat rooms and even instant messaging. The tools at our disposal provide us with the means of joining in existing discussions or hosting them. Your Linux system is the perfect platform for hosting a server, and doing so need not be complicated. Witness this simple little package called geektalkd, written by Michael Plump who credits David Elkins with a lot of the bug fixes. geektalkd is a simple chat server written entirely in Perl. Its simple, open-source nature, makes it easy to extend, modify or simply appreciate. It supports channels, private discussions and more.

To install and run geektalkd, you will need to have the Net::Ident Perl module installed. The easiest way to do this is by using Perl's CPAN mode. You can do the entire installation on the command line by typing:

perl -MCPAN -e "install Net::Ident"

If this is the first time you have installed something using the Perl CPAN shell, you'll have to go through a little question-and answer-session. For the most part, you can accept everything the system suggests with a couple of exceptions, notably those having to do with selecting a mirror. Depending on whether this was your first time or you whether you have been around the CPAN block before, this might take a minute to several minutes.

When this is done, extract and build geektalkd:

tar -xzvf geektalkd-1.23.tar.gz
cd geektalkd-1.23
perl install

That's it. Running the server is as simple as typing the command itself, which will then fork into the background. You might want to consider adding the -l option and specifying a log file, or adding the -p to specify another port number. By default, geektalkd runs on port 41000:

/usr/local/sbin/geektalkd -l /var/log/gtd_log -p 41001
With the server running, all a client has to do is telnet to the port.
telnet your_site.dom 41000
The server then responds with a connect message. Type /help for a list of commands.

Another candidate for an extremely easy chat server is the Shadowlands Forum. Written by Jeremy Monin, Dan Chin and Matt Lochansky, this software is a highly functional chat room with some excellent (and occasionally just plain fun) features. For instance, users can set options such as away messages, idle timeouts, create macros, enable mail checks (for local users) and much more. Administrators can set defaults for the whole room, decide who participates and who doesn't, set topics and so on. To try out Shadowlands Forum, pick up your copy at www.shadowlands.org/forum, then extract the software into a local directory:

tar -xzvf slforum-1.9.6.1.tar.gz
cd slforum-1.9.6

Next, you'll want to edit slfprefs.h before continuing. This contains site-specific configurations, such as slforum's home directory and where its files live. If your system uses shadow passwords, you will need to uncomment the #define USE_SHADOW line (the default uses PAM). You also can edit system messages here, or you could, of course, accept the defaults. When you are happy, compile the program like this:

make -f Makefile-linux
There is no make install. When the compile is done, simply copy the slforum executable to an appropriate directory. If you are using PAM, you also need to copy slforum.pam to the PAM directory (cp slforum.pam /etc/pam.d/slforum). It is now time to run your new chat room:
./slforum -ag marcel +aa /path_to/chat.log
The -ag option identifies the group ID of the admin group to the server. Meanwhile, the +aa option turns on the guest auto-accept feature. As for the log file at the end of the command, this can be anything you like. Use -h to see all the options. To use the forum, use any telnet client and connect on port 7777:
telnet your_site.dom 7777
From there, you can either log in as guest or as a member of the admin group. Guests will be asked for their handle (or name) and admins will have to enter a password. Once you are logged in, you can get a list of available commands by typing !help. Shadowlands Forum is loaded with features. It even comes with a magic 8 ball to help answer all of life's complex questions.
marcel> !8 ball Should I serve Chenin Blanc with
    on-line fora?
FORUM: The 8 ball has advised marcel:
FORUM: To Answer Would Dishonor the 8 ball
Well, mes amis, perhaps this 8 ball is not very useful after all.

The final item on tonight's menu is an instant-messaging client. What, you might ask, is the difference between the chat servers already featured and instant messaging? The two seem similar indeed. The difference is that every other chat tool we have worked with requires that you connect to a central location. The only way to find out whether another person is on, is to connect.

Instant-messaging protocols like Jabber (www.jabber.org) make it possible to chat in real time with a friend or relative (colloquially known in IM parlance as a buddy) in the same way as our previous examples. The difference is that IM clients communicate with each other, letting you know when your buddy comes on-line. Jabber, by the way, is an open, nonproprietary, XML-based instant-messaging protocol you should consider using as an alternative to the other services. In fact, Jabber's open nature means that you can run your own server, an ideal situation for private intranets.

It is entirely likely that you already have a fine Jabber IM client loaded on your system. It is called Gaim. It was originally written by Mark Spencer and is now maintained by Rob Flynn (with the help of the usual band of dedicated coders and patch writers). We will be using Gaim to set up a Jabber account, but Gaim also can talk to AOL's instant-messaging client, and Yahoo's client, and Microsoft's MSN client and others as well. This multiprotocol support is achieved through the use of plugins, making Gaim one of the most flexible instant-messaging clients around.

If you don't already have Gaim on your system, pick up the latest source at gaim.sourceforge.net. Building the package is a matter of executing the old extract and build five-step:

tar -xzvf gaim-0.59.6.tar.gz
cd gaim-0.59.6
./configure
make
su -c "make install"

Start Gaim, either from your menu or by typing gaim & at the command line, and the main Gaim window will appear (Figure 1).

Figure 1. Starting Gaim for the First Time

The first time you start up Gaim, you'll get a simple window with text fields for Screen Name and Password. The Screen Name field will have the words <New User> entered letting you know you don't have any accounts set up. Obviously, mes amis, before we start using instant messaging through Gaim, we will need at least one account, non?

Look below the text fields and you'll see six buttons labeled Quit, Accounts, Signon, About, Options and Plugins. By default, Gaim is ready to accept an ICQ account (if you already have one). In order to use Jabber as one of your protocols, you may need to load its plugin, which isn't activated by default. This is very easy to do. Click the Plugins button.

The Gaim Plugins window appears. Click on Load, then select a protocol from the pop-up list. In the case of Jabber, you would click on libjabber.so and click OK. You would follow the same steps to load the Yahoo protocol (libyahoo.so) or the MSN chat protocol (libmsn.so). Once you have loaded the Jabber plugin (or any other that took your fancy), click Close.

When the plugin window disappears, click the Accounts button. The Account Editor window will appear with nothing in it.

Click Add and the Modify Account window will appear. Halfway down that window, you should see a drop-down list labeled Protocol. By default, it says AIM/ICQ. Click on it, select Jabber, and watch as the window changes to reflect the requirements of setting up a Jabber account.

Figure 2. Creating or Modifying a Jabber Account

Enter your Screenname, Password and Alias, then click on the Register with server radio button. If you would like your Gaim client to log in to Jabber automatically every time you start up the client, click on the Auto-Login radio button as well. When you are happy with your changes, click OK. Your Account Editor window will show your new account (Figure 3).

Figure 3. Adding or editing your accounts is easy.

You can sign on here either by clicking the Sign On/Off button or by clicking Close and signing on from the main Gaim window. With your first time in, you'll get a welcome message from the Jabber.org server. You can close this window or visit the site (as indicated in the message) for additional information.

Now that you have your very own Jabber instant-messaging account, you need people to talk to. There are on-line chats you can join by clicking File on the menubar and selecting Join A Chat. You also can use the keyboard shortcut Ctrl-C instead. Add friends to your Buddy List by selecting Add A Buddy from the menu.

After you have added buddies to the list, they will get messages letting them know that you want to add them. When they see the pop up, they will click Accept, at which point you can begin conversing.

This accepting of buddies has to happen at both sides of the connection. They accept you, after which you accept them. Think of it as saying “I do”, but to a more casual, dare I say, virtual, relationship. François, all this closeness is calling for Champagne, would you not agree? Perhaps we should share a bottle with our guests before they leave, non? Vite, François! To the wine cellar. The 1988 Brut Champagne Rare, please.

While François is off to get the Champagne, we'll finish up our examination of Gaim. Once all this accepting has taken place, your buddy will appear on your buddy list. An icon beside the name on your buddy list will indicate whether your buddy is on-line. If so, double-click on the name and start chatting. It is that easy.

Figure 4. Talk all you want, instantly.

Gaim is highly configurable as well. Click Tools and Preferences for a list of options. One I particularly like (under Conversations) is the option to have all conversations tabbed in one chat window. If you find yourself talking to a number of people, this is one you will definitely want to set.

Ah, François, welcome back, mon ami. Please pour a glass for our friends. I fear that closing time is upon us again. Until next month, mes amis, let us all drink to one another's health. A votre santé! Bon appétit!

Resources

Marcel Gagné lives in Mississauga, Ontario. He is the author of Linux System Administration: A User's Guide (ISBN 0-201-71934-7), published by Addison-Wesley (and is currently at work on his next book). He can be reached via e-mail at mggagne@salmar.com.

LJ Archive