Architecture and Setup
This document describes the MCAST web server, and provides instructions for setting up your own web server.
Web server architecture
The figure above illustrates the flow design of the MCAST server. Grey boxes indicate web pages that the user sees.
The site is run via the following three CGI scripts:
These scripts are stored in the
nph-SVMsubmit.cgi
: This is the main script that prints the user interface form, reads the input, starts the job, and analyzes the results.nph-endpointtest.cgi
: This script runs periodically, in response to a client pull, and checks the status of the user's job. If the job is finished, it displays the results. Otherwise, it runsnph-placeholder.cgi
.nph-placeholder.cgi
: This script displays a web page showing the status of the job, either running or an error.cgi-bin
directory.
The three primary CGI scripts use a shared code library, stored in
cgi-bin/SERVER
. In the source, a code library namedFoo
would be accessed by doinguse SERVER::Foo
. The libraries are as follows:
CGIutil.pm
: A library of existing code that deals with common situations in CGI. The code here is generic, and much of it is not used by the MCAST server. It
- validates forms for legal input (used here),
- managed file uploads (not used here), and
- handles errors. The
CGIutil.pm
error handler is only used under restricted conditions, and is usually replaced by a custom error handler.Globals.pm
: Defines all paths and constants for the code, and error handler, parsing of log files, and some HTML tidbits that appear commonly on pages.Queue.pm
: Common functions for implementing a job queue. These include
- creating and reading queue signal files,
- entering a job in the queue,
- removing a job from the queue,
- checking whether a job is done, and
- running the command lines that are waiting.
Process.pm
: Common functions for managing IPC, forking, etc. These functions include
- creating and reading the signal files,
- checking and setting up the environment for forking,
- checking whether a job is done, and
- canceling a job.
UID.pm
: Common functions for managing user ids, temporary directories, etc., including
- choosing a user id,
- validating a user id, and
- creating a directory for a user's stuff.
Log.pm
: Common functions to manage logs, including
- creating a log file for a job,
- writing to the log, and
- notifiying the admin on errors by email. Note that this function only works if the mail server allows unauthenticated mail from the web server.
Note that the
Queue
andProcess
libraries work closely together.Most of the web server code, as well as the description above, were written by Paul Pavlidis for the Gist SVM web server.
Setting up your own web server
Following are the steps you should follow in order to set up your own web server. These instructions assume you are working in a Unix environment.
- Download and install Meta-MEME from the web site. For more information, read the installation instructions.
- After compiling Meta-MEME, change into the directory
web/mcast/bin
and typemake all
. This will create soft links from theweb/mcast/bin
directory to the programs that are required by the MCAST server. Note that if you runmake all
on a different machine than your web server, you may need to edit theARCH
variable inweb/mcast/bin/makefile
.- Edit the file
web/mcast/cgi-bin/SERVER/Globals.pm
so that the variables listed at the top of that file are correct for your system.- Configure your web server...
The MCAST software was developed by Timothy Bailey at the Advanced Computational Modelling Centre at the University of Queensland and William Stafford Noble in the Department of Genome Sciences and Computer Science at the University of Washington. Computational resources are provided by the National Biomedical Computation Research at the San Diego Supercomputer Center. NBCR is funded by the National Center for Research Resources (P41 RR08605-07).