Project's Home Page
Table of Contents Document Overview The Project Repository Dependencies Building and Deploying OME
Project's Home Page IV. Building and Deploying

 
  SBDD>Building and Deploying>Deploying Previous   Next  
 
 
 
IV-2. Deploying
 

As a first step, you will have to create a directory to host some of the OME components. We’ll refer to this directory as OME_DEPLOY in the following instructions. You may want to set OME_DEPLOY to /OME, as in the following example:

mkdir /OME

You then create the following subdirectories in OME_DEPLOY:

  • html
  • JavaScript
  • images
  • cgi
  • perl

After that, copy everything from:

  • <CVS_LOCAL>/OME/src/html to <OME_DEPLOY>/html
  • <CVS_LOCAL>/OME/src/JavaScript to <OME_DEPLOY>/JavaScript
  • <CVS_LOCAL>/OME/images to <OME_DEPLOY>/images
  • <CVS_LOCAL>/OME/src/perl2 to <OME_DEPLOY>/perl

Obviously, you have to replace <CVS_LOCAL> and <OME_DEPLOY> with the actual directories. Now, copy the OME_JPEG executable from <CVS_LOCAL>/OME/src/C to <OME_DEPLOY>/cgi.

All the above can be done by issuing the following commands (assuming you are in CVS_LOCAL and that OME_DEPLOY is /OME):

cp -r /OME/src/html /OME/html
cp -r /OME/src/JavaScript /OME/JavaScript
cp -r /OME/images /OME/images
cp -r /OME/src/perl2 /OME/perl
mkdir /OME/cgi
cp /OME/src/C/OME_JPEG /OME/cgi/OME_JPEG

Notice that CVS_LOCAL contains some CVS subdirectories. These need not be copied as well. The above commands will uselessly copy them too.
  File system
 
 

You have to add a new user and a new group for OME. Name ome both the OME user and the OME group. At this point, you have to change the ownwership of the OME_DEPLOY directory and of everything contained in there. Of course, the new user and group will have to be ome, as in the following example (OME_DEPLOY is /OME):

chown -R ome:ome /OME

The next step involves setting appropriate file and directory permissions for the OME user and group. First of all, grant read/write/scan privileges on the OME_DEPLOY directory (OME_DEPLOY is /OME):

chmod 0770 /OME

Then, grant read/scan privileges on the html, JavaScript, images, perl and cgi directories (OME_DEPLOY is /OME):

chmod 0550 /OME/html /OME/JavaScript /OME/images /OME/perl /OME/cgi

Now, set read privileges for all the files in html, JavaScript, images, and perl (OME_DEPLOY is /OME):

chmod -R 0440 /OME/html/* /OME/JavaScript/* /OME/images/* /OME/perl/*

Finally, set read/execute privileges for all the files in cgi (OME_DEPLOY is /OME):

chmod -R 0550 /OME/cgi/*

Notice that users that are not in the OME group have no rights on files and directories in OME_DEPLOY. The only user in the OME group other than the OME user shall be the Apache user. Add it to the OME group (the Apache user name is often apache).

  Users, ownership and permissions
 
 

You will need to configure Apache to run with mod_perl and serve things out of <OME_DEPLOY>/perl. Also, you will need to configure Apache in order to serve static content, which is located in the images, html and JavaScript directories under OME_DEPLOY.
One quick way to do that is by configuring the Apache ’main’ server. Follows an example of the relevant directives in your httpd.conf file (/OME is OME_DEPLOY in this example):

Alias /html/ /OME/html/
Alias /JavaScript/ /OME/JavaScript/
Alias /images/ /OME/images/
ScriptAlias /cgi/ /OME/cgi/
PerlSetEnv PERL5LIB /OME/perl/
PerlFreshRestart On
<IfModule mod_perl.c>
    Alias /perl/ /OME/perl/
    <Location /perl>
        SetHandler perl-script
        PerlHandler Apache::Registry
        Options +ExecCGI
    </Location>
</IfModule>

However, you may want to do this by using virtual hosts. You will need a host name for your virtual host. Unless you register your virtual host with a DNS, you need to set up your /etc/hosts file to resolve this to an IP address. The same trick can be done using NetInfo Manager on OS X. After sorting that out, you can simply copy the above directives in your <VirtualHost> block in the configuration file.

When you’re finished editing the configuration file, make sure the syntax is correct by typing:

sudo apachectl configtest

Then, don’t forget to restart Apache:

sudo apachectl restart

  Configuring Apache
 
 

If you are a developer, you may want to add the directive:

PerlModule Apache::StatINC

and the following two lines inside the Location block:

PerlInitHandler Apache::StatINC
PerlSetVar StatINC_Debug 1

These directives cause your entire Perl dependency chain (@INC) to be checked for modifications each time a child services a request. Very handy in development environments, but slow and unnecessary in production.

A warning for developers. Some OME developers experienced problems with virtual hosts. Apache was reported not to refresh consistently with changes in the files that were pointed by the virtual host. Should you experience similar problems, you can make use of symbolic links.

  For developers
 
 

To finish up the installation, you will have to run the bootstapOME.pl script contained in OME/src/SQL under CVS_LOCAL. This script needs to be run as root and both Apache and PostgreSQL must be running.

The bootstrapOME.pl will:

  • Create some OME directories. You'll be asked to enter the OME base directory; unless you have a particular reason not to do so, we reccomend that you set this to the value of OME_DEPLOY and then accept the default values for the repository and input directories.
  • Ask you to enter the database administrator username. This has to be an already existing Unix user; we reccomend that you specifiy the OME user, ome.
  • Create the OME database and load the schema.
  • Create an initial OME experimenter. This will default to whomever you selected as the database administrator. After installation, you can create new OME experimenters by running the addOMEuser.pl script contained in OME/src/SQL under CVS_LOCAL.
  • Install the core analysis modules.
  • Create an analysis chain to run at image import.

Note: The bootstapOME.pl script will try to find out the login name of the Apache user. Should it fail to do that, you'll be asked to enter it manually.

  Finishing up
 
 

Now, you only have to point your favourite Web browser to:

http://your.ome.site/perl/serve.pl?Page=OME::Web::Home

(the actual host name and path before serve.pl depend on how you configured Apache)

Enjoy !

  Accessing the system
 

 
 
 
  Top Building and Deploying Previous   Next