Menu

Tag Archives: apache

What I would like to do is run multiple instances of SequenceServer under different sub-directories on one domain, e.g. http://richardslab.exeter.ac.uk/blastocladiella and http://richardslab.exeter.ac.uk/hyphochytrium but running from one source code directory and one central location for blast databases (although the FASTAs should be in different sub-directories).

This is how I managed it. It’s similar to the way I have set up multiple copies of mediawiki. It’s a little involved, but it seems to work and there may well be other ways – which I would be interested to hear about – and so I can’t guarantee this is the correct, sanest or safest way! So YMMV. However, there are a few challenges to get through first.

Ruby 1.9.* has had a few security updates and in so doing they have removed “.” (the current directory) from load PATH. There’s lots of talk about it on the internet (e.g. here) with various solutions to get it running. It took a bit of figuring out for SequenceServer which would not run directly from github for me, but I think I have cracked it for the latest version (as of 2014-03-31 – 0.8.7?) if you are running it through Apache with Phusion Passenger. Incidentally – and this may be testament to my lack of knowledge of (and desire to know about) Ruby but it won’t run from the command line unless we make a different set of changes. But I suppose you can always install the gem rather than github for that scenario… Unless some one else can help out on this front…

The reason I am running from git source is that I’m not sure where the ruby gem files get installed or what ruby gems does with them and so this way I can be in control of exactly what files I am going to change below…

1) Install SequenceServer from github

First lets put SequenceServer somewhere safe.

cd /usr/share/

Then clone the source from github;

sudo git clone https://github.com/yannickwurm/sequenceserver.git

You’ll notice you cannot run ./bin/sequenceserver without it throwing an error. We will fix that shortly. You may want to at this point run

sudo bundle install && sudo gem update

in order to make sure any ruby gem dependencies that are needed are installed and updated.

You will also need to make sure you have Phusion Passenger installed for Apache.

gem install passenger

passenger-install-apache2-module

Don’t worry about adding the second part to your Apache config, we’ll do that below… BUT you do need to add the first bit!!!

First make a directory for your the first instance of SequenceServer you want to run. In this example I have called my directory blast_genome_n; where n = 1…n etc. You might like to make it something more specific to your needs.

cd /etc/sudo mkidr blast_genome_ncd blast_genome_n/

Now we are going to make symlinks to our source code repository in /usr/share/sequenceserver – Note, that we want to get the files (*) from the directory, not the directory itself. We shall be copying them to our current location ‘.’

sudo ln -s /usr/share/sequenceserver/* .

Next comes a bit that you don’t want to mess up. We are going to be removing two of the symlinks and replacing them with copies of a static file. This is because they both contain information that will be specific to each of your instances…

sudo nano config.ru
We edited this file previously, but we need to update it with the proper location of our configuration file (e.g. this is where you specify the blast database locations etc). So, add this bold line;

Make sure it is to the “public” directory! Incidentally, you can also change files in the public directory to ‘static’ files and make individual changes to each server portal, e.g. web page colours…

5) Repeat

Repeat Steps 3-5 for any other separate genome blast portals you wish to create

6) Restart Apache

sudo service apache2 restart

And you’re done! It should now work! 🙂

Addendum

I run WordPress on the same server in the document root and have mod_rewrite enabled to give nicer URLs, however this will interfere with the sequence retrieval of SequenceServer. So, if you are in the same situation (doesn’t have to be WP, it could be Joomla or any situation where mod_rewrite is interfering) you need to add a few lines to the .htaccess file in the root folder