A heavily modified SequenceServer that is running from the Lotus japonicus genomics and proteomics resource website, manuscript in preparation (Mun et al., 2015)

Setting up SequenceServer

Terry Mun
Terry Mun
Nov 16, 2015 · 6 min read

Ruby on Rails

### Install Ruby using rbenv
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ source ~/.bash_profile

### Install ruby
$ rbenv install 2.1.0
$ rbenv rehash
$ rbenv global 2.1.0
### Update everything
$ gem update
$ gem update --system

Installing SequenceServer and its dependencies

Dependencies

### Install basic dependencies
$ gem install rails
$ gem install passenger
$ passenger-install-apache2-module
### Install basic dependencies
$ gem install rack rack-test rake
### Install qmake
$ yum install qt-webkit-devel
$ find / -name *qmake
$ ln -s /usr/lib64/qt4/bin/qmake /usr/bin/qmake
### Install other development dependencies
$ gem install rspec rubocop capybara capybara-webkit codeclimate-test-reporter

SequenceServer

$ gem install SequenceServer

Updating your Apache httpd configuration file

Info 1: Choice of subdirectory

Info 2: Location of SequenceServer public folder

$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.0
- RUBY VERSION: 2.1.0 (2013–12–25 patchlevel 0) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/terry/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0
- RUBY EXECUTABLE: /home/terry/.rbenv/versions/2.1.0/bin/ruby
- EXECUTABLE DIRECTORY: /home/terry/.rbenv/versions/2.1.0/bin
- SPEC CACHE DIRECTORY: /home/terry/.gem/specs
# and more... #
/home/terry/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/sequenceserver-1.0.4

Info 3: User that Passenger is running SequenceServer with

$ ps aux | egrep '(apache|httpd)'apache    3932  0.0  0.0 498956 10292 ?        S    Nov15   0:00 /usr/sbin/httpd -DFOREGROUND
apache 3933 0.0 0.0 498956 10292 ? S Nov15 0:00 /usr/sbin/httpd -DFOREGROUND
apache 3934 0.0 0.0 498956 10292 ? S Nov15 0:00 /usr/sbin/httpd -DFOREGROUND
apache 3935 0.0 0.0 498956 10292 ? S Nov15 0:00 /usr/sbin/httpd -DFOREGROUND
apache 3936 0.0 0.0 498956 10292 ? S Nov15 0:00 /usr/sbin/httpd -DFOREGROUND
apache 3979 0.0 0.0 498956 10288 ? S 00:15 0:00 /usr/sbin/httpd -DFOREGROUND
$ cd /home/terry/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/sequenceserver-1.0.4
$ ls -l config.ru
-rw-r — r — 1 terry terry 116 Oct 1 16:33 config.ru

Modifying Apache httpd.conf

The template file for httpd.conf

Update SequenceServer’s configuration file

require 'sequenceserver'SequenceServer.init(:config_file => "/home/terry/.sequenceserver.conf")run SequenceServer
---
:num_threads: 4
:bin: "/home/terry/bin/.sequenceserver/ncbi-blast-2.2.31+/bin"
:database_dir: "/home/terry/var/blast-db"

Multiple SequenceServer instances?

Additional Apache httpd configuration

A different configuration file for each SequenceServer instances

# sequenceserver-1.0.4/config.rurequire 'sequenceserver'
SequenceServer.init(:config_file => "/home/terry/.sequenceserver.conf")
run SequenceServer
# sequenceserver-1.0.4-private/config.rurequire 'sequenceserver'
SequenceServer.init(:config_file => "/home/terry/.sequenceserver-private.conf")
run SequenceServer

Symlinking /public folder to original gem’s /public folder

# Go to folder of alternative instance of SequenceServer
$ cd /home/terry/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/sequenceserver-1.0.4-private
# Create symlink to the public folder in actual gem
$ ln -s public ../sequenceserver-1.0.4/public

Coding & Design

All about coding and designing for the web — from HTML, jQuery and CSS to the deep recesses of the art of coding.

Terry Mun

Written by

Terry Mun

Amateur photographer, enthusiastic web developer, whimsical writer, recreational cyclist, and PhD student in molecular biology. Sometimes clumsy. Aarhus, DK.

Coding & Design

All about coding and designing for the web — from HTML, jQuery and CSS to the deep recesses of the art of coding.