E S P r i p t 2.3

Installing the www interface for a simple utilisation of ESPript

This page is for the site administrators who want to install ESPript version 2.3, ESPript.cgi version 3.x and eventually ENDscript on their site.

Upgrading from a previous release

If a previous version of ESPript is already running on your site, please install this new version in another directory. You should be able to reuse the configuration file, only if you come from a 2.0; www 2.5 release. cf. under for details.


Requirements

Before installing ESPript.cgi, you need a unix machine, with the following installed on it:

If you want also to install and use ENDscript, you should install the following programs, too:

If you do not want to install ENDscript, you must proceed as follows:


Retrieving and installing the www interface

After having retrieved the tar file through ftp, please run tar xvzf on it to get the whole hierarchy. Now, you'll have a few things to do in order to configure and run the whole stuff:


Copying files to the correct directories

If you need ENDscript, you must copy the following files to the bin directory, not retrieved with the www interface mainly for licensing reasons:

Moreover, you must also install the above mentionned programs (it could be done in the  bin directory as well) :

Of course, you may not copy any other binary inside the bin directory, as the directory will be used only by ESPript

.

Running install.pl

Now, run the perl script install.pl as follows:

./install.pl --hlpburl /ESPript --cgiurl /ESPript/cgi-bin
--hlpburl is the base url for ESPript, ie it is supposed here that /ESPript is the ESPript home page at your site.
--cgiurl is the base URL for the cgi script, so that it is supposed here that the cgi will be called by /ESPript/cgi-bin/ESPript.cgi at your site.

What does install.pl do ?

install.pl goes to the cgi-bin directory, reads the file called ESPript.cgi.conf-distrib, and writes a new file called ESPript.cgi.conf, with correctly setting the perl variables $ROOTDIR and $CGIURL. Nothing more than that yet.


Editing the configuration file

You have to manually edit the cgi script ESPript.cgi.conf-distrib in order to take into account of the specificities of your site. The parameters to configure are perl variables, whose values are set inside the sub init_all. However, every parameter has a generally acceptable default value, so that you have to take care of this only if the default value is not OK for you. The only required parameters have already been set by install.pl.

Upgrading from an older release

If you already installed a 2.0 version of ESPript (www 2.5), you should already have a correct configuration file. You may thus edit the new file, using the parameters of the old file (copy-and-paste in your editor).

The printer configuration

You can skip this section if you do not want to let your users directly print the calculated postscript file to one of your printers.

variable explanations
@PRTADD This list of regular expressions is matched against the address of the client: if a match is found, the print menu is displayed. if no match is found, the print menu is NOT displayed, thus letting the users print ONLY from some computers.
The simplest is to let everybody from the local area to print, but many other solutions are possible, using more complicated regular expressions.
$PRTCMD The command used to print: lpr (bsd-style), lp (sysV-style), or any other print command.
Warning ! This variable is passed to an 'eval' function, so every special character (ie $, ", etc.) must be escaped with an \
@P An array, describing the printers known by the server: ie lp, lp1, lp2, ...
Warning !The first item of the array must be none, meaning: do not print. I just hope you did not call one of your printers none...
%PL A hash, whose keys are the printers as definig above, the values the description of each printer, as it will be displayed for the users.

Output file types

You can skip this section if you the default file types (Postscript, png 100dpi, png 300dpi, etc.) are OK for you. If you do not want to produce any file type other than postscript, you don't need ghostscript nor ImageMagick.
We suggest using essentially png files, excluding gif or tiff files: ImageMagick now does not use compression for those file types (because of some licensing problems...), so that those files may be very huge (especially in 300dpi).

variable explanations
@F An array, describing the file types you are able to produce.
Warning ! The first item of the array should be 'PS', meaning Postscript type.
@FD An array, describing the default file types proposed to the users.
Warning ! The more file types, the longer the execution of the cgi-bin, as only postscript is produced by ESPript, then the other filet types are converted from postscript.
%FL A hash, whose keys are the file types defined above, the values are the description of each file type, as it will be displayed for the users.
%FC A hash, whose keys are the file types defined above, the values are references to some subs: for each new file type, you must provide a little sub of your own, which is able to effectively perform the conversion (eventually calling extern programs like ghostscript ). See ESPript_exe.cgi for templates of conversion subs.

SRS or 3DBBROWSE SERVERS, or local pdb files

ESPript_exe.cgi is now able to query SRS or 3DBROWSE servers, to get dssp or pdb files, or to get dssp/pdb files from a local file system. It is possible to configure the script to make him query the most efficient server (generally the local file system if the pdb is locally available, or the server nearest from you).
NOTE - For local filesystems only: the pdb files must be all stored in the same directory.

variable explanations
%RETR_URL A hash, whose keys are the strings DSSP, SPDB and PDB. For each key, the url of the wanted SRS or 3dbbrowse server, or the complete directory of the path of the top pdb directory.
%RETR_TYP A hash, with the same keys as above, but the values are the type of request wanted: SRS or 3DBBROWSE or LOCAL
%RETR_DB A hash, with the same keys as above, but the values are the database used: pdb or dssp or "" (for local access).

Disabling SRS or 3DBbrowse queries

It is possible to completely disable this functionality, specifying empty hashes for %RETR_URL and %RETR_TYP. It this case, you do not need to have (thus you do not need to install) libwww-perl.

Limits

The default values for those parameters should be correct, so you can skip this section. However, if you want to modify some limitations, may be you should have a look here.

variable explanations
$S0 A compilation parameter in ESPript, telling the program how long the alignment can be (in AA). This variable must have the same value than the compilation parameter, so that the display is consistent with the binary code.
$S9 A compilation parameter in ESPript, telling the program how many sequences could be handled by the program. This variable must have the same value than the compilation parameter, so that the display is consistent with the binary code.
$CGI::POST_MAX The max size of the uploaded files. This variable is important as it can help avoiding deny of services attacks. It defaults to 4 Mb, however this may be too low for uploading several big pdb files. Should this happen you might modify this variable.

Other parameters

The default values for those parameters should be correct, so you can skip this section.

variable explanations
$PATH For security reasons, the PATH environment variable is redefined by the script itself. You may leave this variable to "" the default value, which should be OK for a standard installation on ghostscript and ImageMagick. However, you may define this variable to any value needed to execute the extern programs.
$CAUTION The url of some gif or jpeg icon used for warning messages
$GOTOP The url of some gif or jpeg used as a navigation tool (blue up triangle)
$ESP_EXE The ESPript program itself.
$S9 A compilation parameter in ESPript, telling the program how many sequences could be handled by the program. This variable must have the same value than the compilation parameter, so that the display is consistent with the binary code.
$UMASK The umask for temporary file or directory creation. Use 77 (default value) for security, 0 (no access restriction) only if necessary.
$TAR_EXE The tar program.
$GZIP_EXE The gzip program.
$CONVERT_EXE The convert program (from Imagemagick, for ps to gif or other conversion).
$DSS_EXEP The dssp program.

Other environment variables

You may configure any environment variable in the configuration file; some of them are necessary for helper applications, especially if you choose to install ENDscript. Please have a look to the automatically generated configuration file, and to the following scripts (found under html/scripts directory):

Other configurable directories

Those parameters are given a "reasonnable" value, however you can modify this value if necessary.

variable explanations
$TMPURL A "temporary URL": it is used by the script to store temporary files, and these files can be retrieved as any html link.
$TMPDIR The directory pointed to by $TMPURL
$HLPBURL The base url for ESPript (Help Base URL)
$HLPBDIR The directory pointed to by $HLPBURL

Running install.pl --conf

You must run the perl script install.pl as follows, after each modification of the configuration file:

./install.pl --conf

What does install.pl --conf do ?

install.pl --conf:

Running install.pl (--make)

You may now run

install.pl
as follows:

./install.pl --make

This just calls the make utility, to compile the fortran programs.


Choosing a security mode

Two securities modes may be used: the first one is called "low security", as the second one is called "high security".
The problem is that several files and directories must be written by your web server. Thus the permissions of those files must be correct. There are two ways to achieve those requirements:

Low security

This mode is called "low security" simply because it is considered as a security hole to have files and directories with the permissions bits 777. However, you may consider that this risk is somewhat limited, because of the few number of files involved. You may install ESPript in low security mode without working as root.
To configure this mode, just type:

./install.pl --secu=low

High security

In this mode, you must be able to give to the web server user (generally nobody or any other restricted account) the ownership of some files. Thus, you must be root to configure this security mode.:

su (working as root)
./install.pl --secu=high --user=nobody
supposing the the web server runs under the nobody user. (I hope it does not run as root ???? In this case, the security mode is just: none...;)


Configuring your server

You must configure the mime types of postscript and pdb files on your server: the right column in the following table gives the line which be present in the srm.conf, unless you prefer to declare the type in the mime.types file (Only if your server is Apache, see your server's documentation if not). Do not forget to restart the server after any configuration change, however

.
file type mime type Apache directive
.ps application/postscript AddType application/postscript ai eps ps
.pdb chemical/x-pdb AddType chemical/x-pdb .pdb

The httpd.conf file should also be correctly configured, with scriptalia and alias directives, so that the home page and the cgi script can be correctly retrieved by the http server (see above the switches --hlpburl and --cgiurl). Here is an example, you could copy and paste at least if Apache is your web server:

    ScriptAlias /ESPript/cgi-bin "/usr/local/ESPript/cgi-bin"
Alias /ESPript "/usr/local/ESPript/html"
<Directory "/usr/local/ESPript/current/html">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/usr/local/ESPript/current/cgi-bin">
Options FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>

WARNING - Please note you should not export through your web server the whole ESPript hierarchy: some programs are found here, which are not free software. Thus you could get legal problems. Only two directories need to be seen by the web server: the html directory (home page), and the cgi-bin directory. That's all.


Cleaning the temp directory

When the users upload files, those files are stored in the directory pointed to by the $TMPDIR variable. If they press the button "Exit", those files are destroyed. However, many users will forget to do so, or some communication problem will make this impossible. It is thus indispensable for the web master to clean that directory on a regularly basis. ESPript_exe.cgi helps you with providing two tools:

The .lck files

Every time someone calls the cgi script, a "session id" is allocated by the system: let's suppose 1000 is the allocated session id. The script will create a directory, named 1000. All session-related files are kept inside this directory, namely a file called lck. The session id is kept by the client (through a hidden field in the form), so that every time a button is pressed, ESPript_exe.cgi is able to retrieve the previously uploaded files. Besides, a line is added to the .lck file, so that it is possible for the administrator to know more or less how the script is used... Please note that this file is not destroyed when the Exit button is pressed.

The ESPript_clean.pl script

When you call this script as follows:

ESPript_clean.pl 45
The lck files are searched for, and for every file untouched for at least 45 minutes, the whole corresponding session is deleted (even the lck file). It is thus recommended calling this script from a cron (every 5 min for instance), to insure that the file system does not get saturated.
ESPript_clean.pl lives inside the bin directory, and is configured by install.pl --conf together with ESPript_exe.cgi.


Enabling/disabling ESPript

ESPript is now installed, but it is disabled: you must enable ESPript before the users can play with it. This is done with the command:

./install.pl --enable

If later you want to disable ESPript, for example to install a new release, please use the command:

./install.pl --disable
The disable switch creates a file called wwwnologin.html inside the html/ESPript directory. If someone is already using ESPript, nothing happens for him. However, all new users will be forbidden, as they cannot open a new session. Thus, you just have to look at the temporary directory; when this directory is empty (ie every session is closed), you may work on the software, nobody will loose any file.

Local databases

ENDscript uses some databases: these must be installed, and up to date, on your system. Those databases are:

Databases used with BLAST:

Those database files must be deposited in $BLAST_DB. Every database deposited here will appear in the list of databases, inside the BLAST box in ENDscript. Please do not forget to run the program formatdb after each update of the fasta files.

Pdb and related databases:

It is possible to retrieve the pdb files when they are needed from a remote site using different protocols, however if you want to install ENDscript you'll have to install the pdb locally. The pdb may be retrieved (updated each week) from rcsb.
ENDscript needs a database of dssp files, and of spdb cleaned files (just for better performance, as very often we need a lot of dssp or cleaned db files). This database may be updated using the script pdb2dssp.pl found in the bin directory.

Link between pdb and swissprot

ENDscript needs to know which pdb ID corresponds to which Swissprot ID. This is possible only with the file pdbtosp.txt you may retrieve from expasy. You should retrieve this file regularly, as it is very often updated. This file must be deposited in the directory $ROOTDIR/html/ENDscript/


Emmanuel Courcelle <emmanuel.courcelle@toulouse.inra.fr>
Last modified: Tue Mar 31 17:05:00 2006