Image for post
Image for post
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

### 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
$ gem install SequenceServer

Updating your Apache httpd configuration file

$ 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
$ 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
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?

# 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
# 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…

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.

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.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store