Deploying the latest github to apache (React frontend)

Hi there
I was just keeping track of the new code with the React frontend and did some tests to deploy it with Apache

There were a couple modifications that I had to make to deploy with apache though so I thought that I’d share them!

I’m not very good with ruby so I’m not sure how to make these “configurable”, but at least one of these changes, the last one, was pretty important for making it work!

  1. Add configurable path for blast outputs

diff --git a/lib/sequenceserver/job.rb b/lib/sequenceserver/job.rb
index a82635a…fde29aa 100644
— a/lib/sequenceserver/job.rb
+++ b/lib/sequenceserver/job.rb
@@ -11,7 +11,7 @@ module SequenceServer

Provides access to global config and logger object as instance methods.

Sub-classes must at least define run instance method.

class Job

  • DOTDIR = File.expand_path(’~/.sequenceserver’)
  • DOTDIR = File.expand_path(’/custom/path/for/tmpfiles/’)
  1. Add configurable path for log outputs

diff --git a/lib/sequenceserver.rb b/lib/sequenceserver.rb
index 83e6d9a…9a6c9b7 100644
— a/lib/sequenceserver.rb
+++ b/lib/sequenceserver.rb
@@ -29,7 +29,7 @@ module SequenceServer
end

def logger

  • @logger ||= Logger.new(STDERR, verbose?)
  • @logger ||= Logger.new("/custom/path/for/log.txt", verbose?)
    end
  1. This is a weird one, but I had to change the “redirect” code on the backend, and also change the React “router” code. Not sure if this was needed or if there is a workaround, but this was the most important fix to get it working on a subpath

diff --git a/lib/sequenceserver/routes.rb b/lib/sequenceserver/routes.rb
index b531ced…7c84039 100644
— a/lib/sequenceserver/routes.rb
+++ b/lib/sequenceserver/routes.rb
@@ -79,7 +79,7 @@ module SequenceServer

the results when available.

post ‘/’ do
job = Job.create(params)

  • redirect “/#{job.id}”
  • redirect “/our_new_blast/#{job.id}”
    end

diff --git a/public/js/sequenceserver.js b/public/js/sequenceserver.js
index 5186f8d…8ed81d7 100644
— a/public/js/sequenceserver.js
+++ b/public/js/sequenceserver.js
@@ -132,8 +132,8 @@ SequenceServer = React.createClass({
routes: function () {
return (

); },

Thanks!

-Colin

Hey Colin,

Thanks for trying it out! Let us know how you like the new features. Also, I would like to note that the stuff in master is not production ready.

This should work for sub-uri:

I have to make this configurable. Not sure if you will have to add trailing slash to our_new_blast, and remove preceding slash from the nested routes (/ and /:jid).

I think setting the correct Passenger directive in apache config will take care of logging to the file you want (by redirecting stderr). I think this one - https://www.phusionpassenger.com/library/config/apache/reference/#passengerlogfile

— Priyam