apache configuration for SequenceServer, sinatra error

Hey

I’ve successfully installed SequenceServer and got it working under the default webserver and port 4567. But when I tried to get it run with the apache webserver, I encountered the following problem: After following the instructions (SequenceServer on Apache or Nginx with Phusion Passenger), I modified my apache config file httpd.conf to

<VirtualHost *:80>
ServerName www.diamond.tuebingen.mpg.de

!!! Be sure to point DocumentRoot to ‘public’!

DocumentRoot /var/lib/gems/1.8/gems/sequenceserver-0.8.7/public/
<Directory /var/www/blast/ >

This relaxes Apache security settings.

AllowOverride all

MultiViews must be turned off.

Options -MultiViews

included the path to my SequenceServer config file to the config.ru file

SequenceServer::App.config_file = ‘/home/roedel/.sequenceserver.conf’
SequenceServer::App.init
run SequenceServer::App

and restarted apache.
When I now access www.diamond.tuebingen.mpg.de/blast/ from my web browser, I get the message

Oops! Something went wonky!

Apologies, there was an error with your request: Sinatra::NotFound

I would greatly appreciate any help.

Thanks a lot

Christian

PS. Here is the error log of the apache webserver:

[Thu Feb 06 11:06:00 2014] [notice] caught SIGTERM, shutting down
[ 2014-02-06 11:06:00.8352 19450/7f2777d27740 agents/Watchdog/Main.cpp:538 ]: Options: { ‘analytics_log_user’ => ‘nobody’, ‘default_group’ => ‘nogroup’, ‘default_python’ => ‘python’, ‘default_ruby’ => ‘/usr/bin/ruby1.8’, ‘default_user’ => ‘nobody’, ‘log_level’ => ‘0’, ‘max_pool_size’ => ‘6’, ‘passenger_root’ => ‘/var/lib/gems/1.8/gems/passenger-4.0.37’, ‘passenger_version’ => ‘4.0.37’, ‘pool_idle_time’ => ‘300’, ‘temp_dir’ => ‘/tmp’, ‘union_station_gateway_address’ => ‘gateway.unionstationapp.com’, ‘union_station_gateway_port’ => ‘443’, ‘user_switching’ => ‘true’, ‘web_server_passenger_version’ => ‘4.0.37’, ‘web_server_pid’ => ‘19449’, ‘web_server_type’ => ‘apache’, ‘web_server_worker_gid’ => ‘33’, ‘web_server_worker_uid’ => ‘33’ }
[ 2014-02-06 11:06:00.8393 19453/7f47b8d12740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.19449/generation-0/request
[ 2014-02-06 11:06:00.8459 19459/7fa7a9274740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.19449/generation-0/logging
[ 2014-02-06 11:06:00.8462 19450/7f2777d27740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-02-06 11:06:00.8676 19473/7f224c2f0740 agents/Watchdog/Main.cpp:538 ]: Options: { ‘analytics_log_user’ => ‘nobody’, ‘default_group’ => ‘nogroup’, ‘default_python’ => ‘python’, ‘default_ruby’ => ‘/usr/bin/ruby1.8’, ‘default_user’ => ‘nobody’, ‘log_level’ => ‘0’, ‘max_pool_size’ => ‘6’, ‘passenger_root’ => ‘/var/lib/gems/1.8/gems/passenger-4.0.37’, ‘passenger_version’ => ‘4.0.37’, ‘pool_idle_time’ => ‘300’, ‘temp_dir’ => ‘/tmp’, ‘union_station_gateway_address’ => ‘gateway.unionstationapp.com’, ‘union_station_gateway_port’ => ‘443’, ‘user_switching’ => ‘true’, ‘web_server_passenger_version’ => ‘4.0.37’, ‘web_server_pid’ => ‘19470’, ‘web_server_type’ => ‘apache’, ‘web_server_worker_gid’ => ‘33’, ‘web_server_worker_uid’ => ‘33’ }
[ 2014-02-06 11:06:00.8720 19476/7f9a1d3b3740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.19470/generation-0/request
[ 2014-02-06 11:06:00.8787 19481/7fc211d16740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.19470/generation-0/logging
[ 2014-02-06 11:06:00.8790 19473/7f224c2f0740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Thu Feb 06 11:06:00 2014] [notice] Apache/2.2.22 (Ubuntu) Phusion_Passenger/4.0.37 mod_perl/2.0.5 Perl/v5.14.2 configured – resuming normal operations
App 19574 stdout:
App 19574 stderr: I, [2014-02-06T11:06:14.661988 #19574] INFO – : Found blastdbcmd at /usr/bin/blastdbcmd
App 19574 stderr: I, [2014-02-06T11:06:14.662080 #19574] INFO – : Found makeblastdb at /usr/bin/makeblastdb
App 19574 stderr: I, [2014-02-06T11:06:14.662116 #19574] INFO – : Found blast_formatter at /usr/bin/blast_formatter
App 19574 stderr: I, [2014-02-06T11:06:14.662151 #19574] INFO – : Found tblastn at /usr/bin/tblastn
App 19574 stderr: I, [2014-02-06T11:06:14.662187 #19574] INFO – : Found tblastx at /usr/bin/tblastx
App 19574 stderr: I, [2014-02-06T11:06:14.662226 #19574] INFO – : Found blastn at /usr/bin/blastn
App 19574 stderr: I, [2014-02-06T11:06:14.662263 #19574] INFO – : Found blastp at /usr/bin/blastp
App 19574 stderr: I, [2014-02-06T11:06:14.662298 #19574] INFO – : Found blastx at /usr/bin/blastx
App 19574 stderr: I, [2014-02-06T11:06:14.787418 #19574] INFO – : Found nucleotide database: gep_closed_assembly at /data/blastdb/Pristionchus_Hybrid_assembly_gapclosed.fa
App 19574 stderr: I, [2014-02-06T11:06:14.787510 #19574] INFO – : Found protein database: P. exspectatus protein predictions at /data/blastdb/exspectatus_all_protein.fa
[ 2014-02-06 11:06:14.8426 19476/7f9a1d2bc700 Pool2/SmartSpawner.h:301 ]: Preloader for /var/lib/gems/1.8/gems/sequenceserver-0.8.7 started on PID 19574, listening on unix:/tmp/passenger.1.0.19470/generation-0/backends/preloader.19574
App 19608 stdout:
App 19574 stderr: 10.39.122.243 - - [06/Feb/2014 11:06:14] "GET /blast/ " 404 827 0.0038

I tried a little bit more and used the information on http://collab.stat.ucla.edu/users/jose/weblog/9e335/

Essentially, I added a symbolic link to SequenceServer in my DocumentRoot folder /var/www

sudo ln -s /var/lib/gems/1.8/gems/sequenceserver-0.8.7/public/ blast

and modified the default file in the /etc/apache2/sites-available folder

DocumentRoot /var/www

Options FollowSymLinks
AllowOverride None

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

RailsBaseURI /blast
RailsEnv development

and restarted apache

sudo /etc/init.d/apache2 restart

Hi Christian,

I’m glad your problem could be solved, and thank you for contributing your solution back to the mailing list.
ben

I followed these tips but couldn’t get to the ‘blast’ page, the httpd error log says ‘…/…/gems/sequenceserver-0.8.7/public/blast’ does not exist. I’m sure this is a simple symlink problem: why is it keep pointing to /public/blast/ instead of /public?

Thanks!

Ke

Hi Ke,

Would you mind sharing your apache config please? Also, first thought is that it might be due to a relative rather than absolute symlink that Christian created - how did you make the symlink?

Thanks,
ben

Hi, Ben,

Thanks for the response! I’ve read a bit more on passenger and apache and have found a solution, mainly from here:

https://www.phusionpassenger.com/documentation/Users guide Apache.html

In the end, I didn’t change the root document, nor did I use any symlinks. I added this block in my httpd configuration:

<VirtualHost *:80>
ServerName *****

!!! Be sure to point DocumentRoot to ‘public’!

DocumentRoot /usr/local/lib/ruby/gems/1.9.1/gems/sequenceserver-0.8.7/public/
<Directory /usr/local/lib/ruby/gems/1.9.1/gems/sequenceserver-0.8.7/public>

This relaxes Apache security settings.

AllowOverride all

MultiViews must be turned off.

Options -MultiViews

create an alias to the application

Alias /blast /usr/local/lib/ruby/gems/1.9.1/gems/sequenceserver-0.8.7/public/

setup the URI

<Location /blast>
PassengerBaseURI /blast
PassengerAppRoot /usr/local/lib/ruby/gems/1.9.1/gems/sequenceserver-0.8.7/

point to the application location

Allow from all Options -MultiViews

Looks like creating the alias ‘blast’ correctly finds the place ‘/var/www/html/blast’. I only used this for CentOS 5.9, so I’m not sure whether it holds for Ubuntu/Debian systems.

Thanks!

Ke

Well, that is pleasing. Thanks for contributing your solution back to the mailing list.
ben