multiple installations on single server

hello

We have 2 types of genomes - public ones that should be freely accessible by the outside world, and unpublished ones that should only be accessible by lab members having password information. what would be the best way to implement two separate installation, so that I setup password protection via .htpasswd on one of them, and leave the other one public.

Thanks!
Volodymyr

Hi again Volodymyr,

Possibly the easiest way would be to deploy seqserv on two different apache sub URIs. Then you can assign a password-protection to one (using .htpasswd if you wish), while leaving the other public. There are some details on how to do this at http://www.sequenceserver.com/

Good luck.
ben

Thanks Ben!

Suppose I’ll want to deploy 2 different URIs. Each of the URIs will have to point to a separate /path/to/seqserv/public, right? What’s the best way to have these two separate installations then? Try to install another ruby gem, and during installation tweek something to make it a separate installation as opposed to overriding existing one? Illustration:

<VirtualHost *:80>
ServerName localhost
DocumentRoot /var/www/
<Directory /var/www>
Allow from all

RackBaseURI /seqserv

RackBaseURI /seqserv-public

/var/www/seqserv => /path/to/existing/seqserv/private/installation/public

/var/www/seqserv-public => /path/to/new/gem/used/for/public/genomes/public ?

Sorry if I’m misunderstanding something simple.

Thanks!
Volodymyr

In case somebody would have the same issue, this is the way I resolved it.

  1. Installed a second copy of the seqserv gem.
    ~/.rvm/path/to/original/seqserv
    ~/.rvm/path/to/copy/seqserv
  2. replaced sequenceserver.conf with sequenceserver-other.conf in sequenceserver.rb file:

set :config_file, Proc.new{ File.expand_path(’~/.sequenceserver.conf’) }
3) created 2 separate configuration files, each pointing to corresponding folder with databases:
~/.sequenceserver.conf : database: /some/folder/with/databases
~/.sequenceserver-other.conf : database: /some/other/folder/with/databases

  1. resolved each URI correspondingly:

Apache conf:

RackBaseURI /seqserv
RackBaseURI /seqserv-public

DocumentRoot:

/var/www/seqserv => ~/.rvm/path/to/original/seqservpublic
/var/www/seqserv-other => ~/.rvm/path/to/copy/seqserv/public

I guess there’s a better way to resolve the issue without having two separate installations, but that would require hacking more code.

Volodymyr

Hi Vologmyr,

Your solution looks quite complex - congrats on getting it to work. I think maybe it would have been easier to check out 2 copies of the seqserv code into two separate directories (using git clone https://github.com/yannickwurm/sequenceserver), rather than having 2 copies of the gem.

But like they say, if it works, it works.

ben

In case somebody would have the same issue, this is the way I resolved it.

1) Installed a second copy of the seqserv gem.
~/.rvm/path/to/original/seqserv
~/.rvm/path/to/copy/seqserv

Two different `config.ru` pointing to different `sequenceserver.conf` will do.

$ pwd
/home/yeban/
$ mkdir ss-foo
$ cd ss-foo
$ cp path_to_ss_installation/config.ru .
$ cp path_to_ss_installation/example.config.yml config.yml

2) replaced sequenceserver.conf with sequenceserver-other.conf in
sequenceserver.rb file:
set :config_file, Proc.new{ File.expand_path('~/.sequenceserver.conf') }

This would be overwritten when you `gem update/install
sequenceserver`, and you will have to redo the above change. So, add
the above line to your `config.ru`s in ss-foo and ss-moo directories
instead:

SequenceServer::App.config_file = '~/ss-foo/sequenceserver.conf'

It's in the FAQ. The line should be added before
`SequenceServer::App.init` in `config.ru`.

Passenger+Apache infers the location of config.ru from the location of
public directory, so let's symlink to the bundled public directory as
well.

$ pwd
/home/yeban/ss-foo
$ ln -s path_to_ss_installation/public
$ cd ..

Just copy around this directory and make required edits to `config.ru`
and `sequenceserver.conf` for other SS instances.

$ cp ss-foo ss-moo
<edits>

3) created 2 separate configuration files, each pointing to corresponding
folder with databases:
~/.sequenceserver.conf : database: /some/folder/with/databases
~/.sequenceserver-other.conf : database: /some/other/folder/with/databases

You can also keep these config files in the ss-foo and ss-moo
directory respectively.

4) resolved each URI correspondingly:

Apache conf:
RackBaseURI /seqserv
RackBaseURI /seqserv-public

DocumentRoot:
/var/www/seqserv => ~/.rvm/path/to/original/seqservpublic
/var/www/seqserv-other => ~/.rvm/path/to/copy/seqserv/public

/var/www/seqserv => ~/ss-foo/public
/var/www/ss-other => ~/ss-moo/public

Sorry for the delayed response. I haven't had much time for SS
lately; college woes :(.

this is a great solution, thanks Anurag!