W2H: The Intranet mode


The standard usage of the W2H interface is based on the UNIX user accounts on the computer where the GCG programs run (server side). Each user connects to the server computer using WWW interface, his or her name is recognized there and all programs and tools are run under his/her name. That means also that the registered users have their home directories on the server side where they store not only their data but also their personal setting to be kept between GCG sessions.

This schema works well in most cases. Nevertheless, there are situations where something less restrictive, requiring less administration work seems to be more appropriate. There are at least two typical situations:

This document describes how to configure the W2H interface to be able to use it in the intranet mode. It requires only very little configuration in Cfg.pl file and nowhere else. Nevertheless, you can easily include your own CGI scripts to start and to finish a session to provide your own look-and-feel.

Table of Contents

Basic configuration
User identification
Keeping user's session setting
Cleaning session data
Working directory
Security consideration

Basic configuration

First of all, to allow the Intranet mode, you must set the variable $INTRANET to yes or true:
$INTRANET = 'yes';
By the way, all variables mentioned above and below have to be set in the configuration file Cfg.pl.

By default, the intranet mode is not set. But all other intranet variables are distributed with reasonable values which allow you to try this mode. The only change you must do is to set $INTRANET to yes.

Second, you must tell where the users data file are to be put (remember that the users have no home directories on the server computer). This is done in the variable $USERS_DIR:

$USERS_DIR = '/tmp';
The variable should contain a directory name which is writable for the user running the httpd server (or better: for the user whose name is specified in the User directive in the httpd configuration file). A special subdirectory _W2H_ will be automatically created here containing the individual directories for all connected users.

A distributed default for $USERS_DIR is $TMPDIR which is set to /tmp.

And finally, there are three main questions to be answered to run the W2H in the intranet mode:

  1. How to identify a user who wants to use the GCG server?
  2. How and how long to keep the personal user setting between sessions?
  3. How to clean and how long to keep the user's data on the server side?

User identification

From the UNIX point of view, all programs on the server side are run under the user specified in the User (or similar) directive in an httpd configuration file. But it is not enough for the intranet mode. We want to keep separately the data and setting of the individual GCG users even if all of them appear to be the same UNIX user.

The variable $USER_ID deals with the user identification. There are several methods to choose from:

Keeping user's session setting

How to remember the current user's setting after finishing a GCG session? The variable $KEEP_STATE deals with it. Again, you have several options to choose from. But before describing them in details let me explain what is not kept.

The data files created by the GCG programs are safely stored in your own data space during your GCG session. But whether they remain untouched also after you exit your GCG session it does not depend on the variable $KEEP_STATE but on an another one ($CLEAN_SESSION) described in the section below. The $KEEP_STATE concerns about your global settings, such as your default printer. Sure, it also stores information about your current working directory and your current working list. But if you let them clean up after exiting the GCG session then this information becomes a little useless.

Now back to the available options:

Cleaning session data

During a GCG session the users create data files on the GCG server computer. Within a current session they can view them or re-use them again and again. But what to do with them when the session is over? In the non-intranet mode it is up to the users to take care about their home directories (and also up to the programs like quota I must admit). In the intranet mode there is a variable $CLEAN_SESSION with several possible options:
  • Do not clean at all
    Put here an empty string to avoid any cleaning:
    $CLEAN_SESSION = '';

  • Clean always
    An exactly opposite alternative. All user's data will be removed when a GCG session exits. Put here yes or true:
    $CLEAN_SESSION = 'yes';
    This is not so bad as it may sound. Remember that all user's personal global options, even his/her last working list can be saved locally using a proper option in $KEEP_STATE variable (see above).

  • Clean if it is too old
    This option is different from the previous ones because it deals with data files of all users. Each time when a GCG session ends it checks all directories specified in $USERS_DIR variable, and remove those directories in which the newest file is older than the number of days specified in $CLEAN_SESSION variable. So it is a sort of automatic cleaning when data are not used long enough. An example:
    $CLEAN_SESSION = '30';
    The data file of all users who have not updated their files within last month will be deleted in a moment when any GCG session finishes. Sure, only files in $USERS_DIR space are touched.

    Note that this option usually does not remove data of the user whose GCG session has just finished because his/her data are very likely too new to be deleted.

Working directory

There is one more variable to configure: $CHANGE_WD_ALLOWED. But it seems to be less important than the others.

If you set it to yes or true users will be allowed to change their current working directory and put their data to a new place. It can be reasonable option but remember that session cleaning described in the previous chapter deals only with data in the standard working directory based on $USERS_DIR variable. New data space will not be cleaned up.

A default value is no or false or an empty string. Then the button Change working directory in the Main Window is disabled. But be aware that the intranet mode is not too keen to restrict users: even if they cannot change to a new working directory, they are allowed to create working lists or data output files somewhere else (if UNIX access rights allow it).

This behavior can be changed in the future if need will arise.

Security consideration

The intranet mode is not less secure than the standard one. But it differs in a fact who is responsible for security. In a standard mode it is a basic HTTP authentication method, and in the intranet mode it is someone else. Often it is a firewall software. But as was shown above you can still use the HTTP authentication procedure in the intranet mode.

If you do not use firewall but want to try or use the W2H in the intranet mode you would probably like to avoid an access of completely foreign users to your server (at least because GCG is a proprietary software). It can be reached by using the HTTP authentication method in less restrictive way allowing an access only from your network domain.

Here is an example what to add to your access.conf file if you want to allow accesses only from your domain (put there your domain name):

<Directory /usr/local/etc/httpd/cgi-bin/w2h>
Options Indexes FollowSymLinks
<Limit GET POST>
order deny,allow
deny from all
allow from .ebi.ac.uk
</Limit>
</Directory>
Or you can configure the same thing using a .htaccess file in the directory w2h:
<Limit GET POST>
order deny,allow
deny from all
allow from .ebi.ac.uk
</Limit>
More about the access configuration can be found at
http://hoohoo.ncsa.uiuc.edu/.


senger@ebi.ac.uk
Last modified: Thu Dec 28 18:00:56 2000