wiki:WirmRepos
Last modified 12 years ago Last modified on 05/08/06 13:34:25

Installing WIRM and repos on SIG servers under Red Hat Enterprise

Last updated 9/26/05 jfb

When complete this document will assume that all wirm production servers are running on sphenoid, and that the purpose of this document is to describe how to create a development version of a wirm server, do some work on it, then update the production version. Right now bmap_repo, image_repo and eyelab_repo are running in the correct locations on sphenoid, so celo is still special case notes that I (jfb) am keeping so I remember how to move this to production status. The notes also assume that the development version will be installed in the same location as the production versions, ie /usr/local/databases/wirm. These notes should be updated to also describe how to install in a user's public_html directory, which is the likely case for those who don't have root privileges.

Most of the operations below need to be done by root. Admin_pass is the same as the mysql wirm password, which is shown in these notes as "sample". Should be something other that for real system. Machine name is synapse for these notes. Change to the appropriate machine when installing.

  1. Pre-requisite software

Much will already be installed. For software which is not, add rpm site to up2date sources

echo 'apt dag-el4 http://apt.sw.be redhat/el4/en/i386 dag' >> /etc/sysconfig/rhn/sources
rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

For WIRM

Should already have perl5, Mysql, CGI

  up2date  ImageMagick-perl
# May need the --nosig flag for some of these , eg up2date --nosig perl-Text-CSV
# For bmap_repo
  up2date  perl-Text-CSV
# For image_repo
  up2date perl-XML-Simple
# This one seems to have a problem. did google search, 
#	  manually downloaded perl-Archive-Zip-1.14-4.i586.rpm
#	  did rpm -i perl-Archive-Zip-1.14-4.i586.rpm
  up2date perl-Archive-Zip 
# For celo
  up2date perl-XML-Parser
  up2date perl-XML-SimpleObject
  1. Mysql
    mysql
    >>  use mysql
    >>  delete from user where User=''  
    #Otherwise wirm@localhost will not have needed permissions
    
    #Give all privileges to wirm user, may remove some privileges. At minumum need select, insert, update, 
    #delete, create database, drop databases (create and drop needed by celo)
    
    >>  grant all on *.* to 'wirm'@'localhost'  identified by 'sample' 
    >>quit
    
  1. Apache web server

In these notes I use symbolic links as per WIRM installation scripts. Could also use aliases.

cd /etc/httpd/conf.d
edit local.conf to handle all local configuration
See synapse:/etc/httpd/conf.d for my approach
Puts Document Root in /usr/local/www/htdocs
     Logs in                        /logs
     cgi-bin in			    /cgi-bin
  1. WIRM
    mkdir /usr/local/databases
    cd /usr/local/databases
    cvs checkout -d wirm src/wirm
    cd wirm
    mkdir var
    cd wirm/wrm/lib
    cp conf.pl.sample conf.pl
    edit conf.pl to have  this configuration
      # Local machine configuration
      %WRM_CONF = (
        wirm_install      => "/usr/local/databases/wirm",
        admin_pass        => "sample",
        var               => "/usr/local/databases/wirm/var",
        doc_root          => "/usr/local/www/htdocs",
        cgi_path          => "/usr/local/www/cgi-bin",
        cgi               => "/cgi-bin",
        htdocs            => "",
        mime_general      => "/etc/mime.types"
      );
    cd conf
    install.pl
    

Test by pointing web browser at

http://synapse.biostr.washington.edu/cgi-bin/wrm/console.pl Should show a page saying "You must first set the repository".

  1. Image_repo

If you want to use the same data as on the production server first make a backup of the production data

  ssh sphenoid
  cd /usr/local/databases/wirm/wrm/lib/backup
  repo-backup.pl image_repo <backupath> (like ~/temp/image-091505)
Now install on another machine, assuming you have root privileges
ssh synapse
mysql -u wirm -p

>>create database image_repo
>>quit

cd /usr/local/databases/wirm/repos
cvs checkout -d image_repo src/repos/image_repo
cd ../wrm/lib/conf
repo-init.pl image_repo
cd /usr/local/databases/wirm/repos/image_repo/htdocs
cp index.htm.sample index.html
Edit as appropriate
If you want to create a new database without copying from the original:
  define_schema.pl
else (if you want the same data as on the production version)
  cd /usr/local/databases/wirm/wrm/backup
  repo_restore.pl image_repo <backuppath> (like ~/temp/image-091505)
cd /usr/local/databases/wirm/var/repos/
chown -R apache.apache image_repo #Apache needs to be able to write here

Test by pointing web browser at

http://synapse.biostr.washington.edu/repos/image_repo Should show main page for image_repo

  1. Eyelab_repo

First make a backup of the production data because there is as yet no define_schema.pl script

  ssh sphenoid
  cd /usr/local/databases/wirm/wrm/lib/backup
  repo-backup.pl eyelab_repo <backupath> (like ~/temp/image-091505)
Now install on another machine, assuming you have root privileges
ssh synapse
mysql -u wirm -p

>>create database eyelab_repo
>>quit

cd /usr/local/databases/wirm/repos
cvs checkout -d eyelab_repo src/repos/eyelab_repo
cd ../wrm/lib/conf
repo-init.pl eyelab_repo
cd ../backup
repo_restore.pl eyelab_repo <backuppath> (like ~/temp/eyelab-091505)
cd /usr/local/databases/wirm/var/repos/
chown -R apache.apache eyelab_repo #Apache needs to be able to write here

Test by pointing web browser at

http://synapse.biostr.washington.edu/repos/eyelab_repo

  1. Bmap_repo
    If you want to use the same data as on the production server first make a backup of the production data
      ssh sphenoid
      cd /usr/local/databases/wirm/wrm/lib/backup
      repo-backup.pl bmap_repo <backupath> (like ~/temp/bmap-092605)
    Now install on another machine, assuming you have root privileges
      ssh synapse
    Create the database
      mysql -u wirm -p
      >>create database bmap_repo
      >>quit
    Checkout the code
      cd /usr/local/databases/wirm/repos
      cvs checkout -d bmap_repo src/repos/bmap_repo
    Initialize the repository
      cd ../wrm/lib/conf
      repo-init.pl bmap_repo
    Set the owner of the writeable directory
      cd /usr/local/databases/wirm/var/repos
      chown apache.apache bmap_repo #Apache needs to be able to write here
    Copy data from the previously backed-up  bmap_repo from the production server
       cd /usr/local/databases/wirm/wrm/lib/backup
       repo-restore.pl bmap_repo ~/temp/<backuppath> (like ~/temp/bmap-092605)
    Edit local configuration variables
       cd /usr/local/databases/wirm/repos/bmap_repo/lib
       edit the file repoconf.pl
          $WRM_CONF{xmridb_path} is directory where the file bmap-xmri-db-data.lsp 
          will be written. This will need to be writeable by the web server. 
          This is a data file used for the skandha based visual
          brain mapper. For development choose a location different than 
          the production location.
    Test by pointing web browser at
       http://synapse.biostr.washington.edu/repos/bmap_repo
       Should show main page for bmap_repo
    
  1. Celo

Current production celo is on sphenoid in /usr/local/databases/merged_wirm, needs to be moved to wirm without losing any data. Needs a backup script. The following shows how to install a new version of celo with no old data.

cd /usr/local/databases/wirm
cvs checkout -d celo src/celo
cd celo
install.pl
cd /usr/local/www/cgi-bin
chown apache.apache labs
cd /usr/local/www/htdocs
chown apache.apache labs
cd /usr/local/databases/wirm/var
chown apache.apache labs
cd /usr/local/databases/wirm
chown apache.apache labs
Test by pointing web browser at 
     http://synpase.biostr.washington.edu/celo
  1. Affected directories for all the above
    /usr/local/databases/wirm
    /usr/local/www/htdocs
    /usr/local/www/cgi-bin
    

For CELO

(JDF version)

--Steps to install CELO on sphenoid:

up2date perl-XML-LibXML
http://dag.wieers.com/packages/perl-XML-Parser/perl-XML-Parser-2.34-1.2.el4.rf.i386.rpm
http://dag.wieers.com/packages/perl-XML-SimpleObject/perl-XML-SimpleObject-0.53-1.2.el4.rf.noarch.rpm

mkdir /usr/local/databases/merged-wirm
cd /usr/local/databases/merged-wirm
cvs checkout -d celo src/celo
cvs checkout -j sig-vivalog-merge-branch -d wrm wirm

cp ../wirm/wrm/lib/conf.pl wrm/lib/
vim wrm/lib/conf.pl # especially change WRM_CONF{cgi} to '/celo-cgi/'

mkdir cgi
mkdir var

cd celo
./install.pl
usermod -G celo apache
vim htdocs/index.htm # change links to '/celo-cgi/'

Add to Apache vhost: ScriptAlias /celo-cgi/ /usr/local/databases/merged-wirm/cgi/t