The cgi-bin environment

CGI-Scripts

The cgi-bin scripts include scripts for analysing and generating words and sentences. The relevant scripts are:

All the scripts are developed in cvs-directory, under the module gt/scripts/cgi-scripts. The official location of cg-scripts is on cochise, at /opt/sami/www/cgi-bin/smi/. The latest versions are moved to the official directory by script cgi-export. The script exports the latest version of the release-tagged cgi-scripts to the directory. The user must have root privileges to be able to run the script.

The procedure for updating the cgi-bin scripts:

  1. Edit the files in cvs-module gt/script/cgi-scripts
  2. Commit the changes to cvs
  3. If the version is ready for release, tag the version with release-tag using command cvs tag -F release filename1 filename2 ...
  4. Log in as a root (sudo su -) and execute the script cgi-export. The tagged files are exported from the cvs to the official directory.

The script cgi-export is in cvs module gt/scripts. There is a restriction in the script: only files with extension .cgi can be released for now.

The structure of the cgi-bin setup

There are webdemos available for analysing and generating wordforms. They are arranged the following way:

On http://giellatekno.uit.no/ there are files d-sme.html, a-sm{a,j}.html (for analysis) and g-sm{a,e,j}.html (for generation). They point to cgi-bin scripts. The pages are not in cochise but in a separate web server.

The cgi-bin scripts are located on cochise, at /opt/sami/www/cgi-bin/smi/ (well, their #actual# location is different, see below, but as far as we are concerned, this is where they are. Here we find the files sma-lookup.cgi (corresponding to a-sma.html), sma-lookdown.cgi (corresponding to g-sma.html), etc., for sme and smj. The cgi-bin scripts process the input sent from the html scheme by the user, and then send it on to the transducers sma.fst etc.

The transducers are located at /opt/smi/sma/bin/, /opt/smi/sme/bin/ and /opt/smi/smj/bin/. They analyse the input, and return an answer via the cgi-bin script back to the user's web browser.

The transducers and other relevant files are updated daily using cron facility. The script gt/script/fst2opt is responsible for retrieving the latest version from cvs, compiling the binaries and copying them to the relevant directories. The crontab is set up by the person who is responsible of the cgi-bin setup.

The cgi-bin files themselves

The cgi-bin files are written in Perl. The files contain a very good documentation themselves (thanks to Ken Beesley, their original author). For info on how to maintain them, see available books on perl and cgi-bin.

The cgi-scripts are eventually changed to use the Perl module CGI.pm.

Linking due to security

For security reasons, the webserver on cochise.uit.no is run via symbolic links. The files themselves are not where they seem to be, but in a more secure environment.

The url to the cgi-bin scripts is: http://sami-cgi-bin.uit.no/cgi-bin/smi/

Trond Trosterud
Last modified: Mon Sep 13 10:32:29 2004