Setting up the clients

Before the advent of the World Wide Web, the Archie searches were performed through ascii interfaces. Now we supply a client that can be incorporated to your Web server. This client allows a user to search through the anonftp and webindex databases. The other clients only perform searches in the anonftp database. We will examine the different clients in this chapter.

Anonftp catalog clients

Currently, the Archie distribution from Bunyip includes two client programs (other than those freely available on the Internet) that enable users to search through Archie anonftp catalog. These are the telnet and email clients. Installation and configuration of these programs are discussed in this section.

In Figure [fig:clients] below, we show the relationships between the various Archie and standard system programs.

Client choices

The telnet-client enables your user community to connect to an Archie server and query the anonftp catalog through a standard telnet (remote login) session. A user shell is provided and supports a query language to enable the user to query the server. The email-client program enables users to send electronic mail containing a series of commands to the Archie server which will then be processed and returned in email to the user. You will have to decide, as system administrator which of the supplied clients, if any you plan to install. You should factor such things as

into your decision. The email and telnet clients can be run “independently” of one another in that you do not have to enable either one for the other one to be made accessible.

The user system programs

The following table describes the programs in the Archie user query system. These programs can be found in the directory.

Program Name Description
telnet-client User interface via the telnet or rlogin protocols. The only program that performs queries. Called by email-client to process queries.
email-client The user interface which processes incoming network email queries.
cgi-client The WWW interface that can be attached to your Web server to perform queries. This will described in more details in section 2.1
archie.shell Bourne shell script wrapper around the telnet-client which restricts the number of simultaneous user telnet Archie sessions. (Optional).
archiemail “Front end” to the Archie outgoing mail system. Used by the telnet-client “mail” command. Only used if the “mail” command or email-client are going to be enabled.
mail_receiver Does most of the work in sending mail to the user (generated by the “mail” command or from the email-client): parsing headers, compressing, encoding, splitting and calling sendmail to mail the resulting data
split_file Used to break large amounts of output into smaller pieces (if necessary), since some mailers are only capable of dealing with messages of limited size.

The telnet client

If you would like your user community to have access to the Archie system via the standard telnet or rlogin programs, you should install the telnet client.

Client privileges and security

The installation phase (as described in “Installing the basic Archie system” on page ) will, in most cases, install the telnet client to operate as a setuid (root) program. With these privileges, the client can change the current

directory to the Archie home directory and call the chroot(2) system call to make this the root of its own directory tree. This has the advantage of reducing any unforeseen security problems when users use rlogin or telnet to connect to the Archie server.

Whether the chroot call is made or not in the telnet client, the GNU less program shipped with the Archie system has been modified to prevent the examination of external files or execution of external processes. The modified version of the sources for this program can be found in

If the telnet-client program is installed suid root and is running on a platform which supports the chroot(2) security feature, copies of the system files , (unless you are using NIS) and must be placed in the directory. This is because the use of the chroot(2) system call will leave the original files inaccessible to the Archie clients.

Enabling the telnet mail feature

Most of the work of setting up the Archie client programs is done by the installation script. However, you must first set up your system to accommodate the new programs. This can be done as follows:

Finally, check over the “configure” sections in the archiemail and mail_receiver scripts which reside in . You should ensure that the variable is correctly set to find the programs used by these scripts.

Limiting the number of telnet sessions

archie.shell is a shell script to limit the number of simultaneous connections to the telnet-client.

The .archierc file

On start-up the telnet-client program reads a file called if it exists. The purpose of this file is to configure the program’s behavior to your particular needs. A number of variables can be set and commands executed before the user prompt is generated. See the manual page archie_clients(n) for a complete explanation.

Testing the telnet client

Once the telnet-client program has been installed and configured, test it out by performing a telnet session to the Archie host, and log in as archie. Perform a “find” command to determine if everything is working correctly.

The email client

The email-client program allows users to access the Archie system via standard Internet mail. It is in fact, just a specialized wrapper around the telnet-client program which does the work of processing the incoming queries (see Figure [fig:clients]). The requests from the email client are given the lowest priority when queued on the Prospero server so as not to adversely affect the operation of interactive clients.

The email-client can be used in one to two main ways, either “interactively” in which incoming email is processed as it is received, or “batched” in which the incoming email is stored and processed later, usually at off-peak times. In either case, to enable the email-client, first you need to enable the telnet-client mail feature as described in section “Enabling the telnet mail feature” on page .

“Interactive” email requests

For interactive email service add the following line to the /etc/aliases file.

As usual, the newaliases program (or the NIS equivalent) will have to be run in order for this change to take effect.

There are a number of options which can be provided to the email-client binary including some to log incoming messages. See the archie_clients manual page for further details.

If your telnet-client binary is not installed as then you should use the “-T” option to tell the email client where the telnet-client can be located.

Batching email requests

Email requests need not be processed directly as they are received on your system. Instead, they can be batched and processed at a later (off-peak) time. To do this change the standard entry in the /etc/aliases file to the following:

By default, this will put each piece of mail in a separate file in . You can override the temporary directory by using the -t option to batch-email which will cause the email messages to be stored in an alternate directory. You should make sure that this is a “safe” directory whose contents will not be lost for example, on a system reboot.

You can then set your system to process the mail at a later time with the process-email program.

For example, if you enter the line:

into the crontab for archuser then each day at 01:00, the mail will be processed. This also takes a -t option like batch-email to provide a different temporary directory. process-email will process each piece of mail in sequence.

Testing the email client

Test the email client by sending mail to . If running as “interactive” email, a response should be generated in a number of minutes. Note that this must be done from a machine other than the Archie host due to the fact that on most systems, the sendmail program runs the user daemon when mail is sent from off the local host, but as the user sending the mail when run on the local host.

Auxiliary files

The following files in are used by the telnet-client and email-client programs. They may be modified to reflect the local configuration.

Filename Description
telnet client email client
email.help x Response to a “help” command or an empty message. For any other form of more specific help (e.g., “help set”), the email-client returns the same information provided by the telnet client.
manpage.ascii x x The pre-formatted version of the Archie manual page.
manpage.roff x x The troff(1) (or nroff(1)) version of the Archie manual page.
motd x x The “message of the day” that the email and telnet clients display to users at the top of email messages or when they log in if set in dirsrv (See “The Message of the Day” on page 52).
serverlist x x The list of servers given to the user in the “servers” command.
whatis x x The Archie whatis database. Entries (one per line) of short descriptions of resources available on the network.

The Help system

The Archie telnet and email client help system is rooted in the directory . The system currently has full multi-lingual support. In order to support languages other than the default supplied with the distribution, one only need create a directory under with the name of that language. For example a directory called francais would enable French language support by allowing the users to type:

at the prompt in the telnet client or in the message body to the email client. The files in the need then to be translated into the new language. The files containing the actual data are called ‘=’ and the subdirectory names themselves provide the menu for that part of the help system. See the manual page archie_clients(n) for further details.

Quoting in the clients

For the email and telnet Archie clients, quoting in the command-line interpreter is handled in much the same way as for the standard csh (see the man page csh(1)). So, for example, the ‘.’ can be treated as follows:

The ‘.’ is treated as a regular expression

The ‘.’ is quoted, and passed along (untouched) to the Archie search also if you specify

you will make sure that the host names returned end with the string “il”. For further details on regular expression consult the regexp(3) manual.

Webindex catalog clients

This section takes a brief look at the WWW client. It provides access to both webindex and anonftp catalogs. Note that this section is still under construction and any comment is very much welcomed.

The cgi-client

The files are:

cgi/html/archie.html Simple search form
cgi/html/archie-adv.html Advanced search form
cgi/html/archie-help.html Help page
cgi/bin/archie.cgi perl script called by the HTML forms
cgi/bin/cgi-client binary called by the perl script

Where to put them ?

In order to provide a consistent way for accessing the Archie database, we think that the urls should always be of the same format for all public Archie server.

This format being

We need to specify the extension to ensure that all WWW server will actually return the documents as HTML documents. Otherwise, some will presume that they are simply ascii.

Configuration

The configuration procedure is as follows:

  1. Move the .html and .gif files to where your web pages are accessed.

  2. Move (or link) “archie.cgi” to the cgi-bin directory of your web server.

  3. Edit the html files “archie.html” and “archie-adv.html” to reflect the appropriate path of the cgi script “archie.cgi” after you have placed it in the right path.

  4. Edit the file “archie.cgi” and configure the first few lines as indicated in the file.

  5. Make sure that the UID for the “cgi-client” binary is set.

  6. Test the forms and if you don’t like the format of the output, take a look at the “archie.cgi” perl script and edit the output variables to your convenience.

How does it work

The “archie.cgi” perl script receives a query (from the archie*.html forms) and calls up “cgi-client”. The cgi-client binary processes the request and sends the results to the perl script in plain record-template format. “archie.cgi” reads the results, reformats the output into HTML and then sends the new output to the web server.

How to reformat the output

“archie.cgi” is the perl script you need to modify. The second segment after the configuration part holds the variables that are sent back to the Web server. Configure any variable to your needs.

Where is the information logged

“cgi-client” logs queries, the number of hits and any error messages to a file in the log file