Sinatra+passenger+apache

78 views
Skip to first unread message

poseid

unread,
Mar 4, 2011, 8:45:54 AM3/4/11
to sinatrarb
Hello,

I would like to deploy a Sinatra app to a Debian server running Apache
+ Passenger.
My rails environment works fine, however I get some problems with
running Sinatra.

Thank you very much for sharing ideas!

Patrick

The details are

the app resides in:

/home/test-env/current

-----------
Config.ru

require 'application'
run Sinatra::Application

application.rb

application.rb
require 'boot'
require 'sinatra'

MongoMapper.connect(Sinatra::Base.environment)

get '/' do
"Hello World"


-----------
/etc/apache/sites-enabled/test-env

DocumentRoot /home/test-env/current/public

<Directory "/home/test-env/current/public">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>


-----------
/etc/apache2/mods-enabled/passenger.conf

PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15
PassengerRuby /usr/local/bin/ruby



I am running out of ideas what to try next. Here is the latest error
log:

-- Ruby level backtrace information
----------------------------------------
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/bin/passenger-spawn-
server:61:in `< main>'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
abstract_serv er.rb:196:in
`start_synchronously'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
abstract_serv er.rb:352:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
spawn_manager .rb:278:in
`handle_spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
spawn_manager .rb:150:in
`spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
rack/applicat ion_spawner.rb:41:in
`spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
rack/applicat ion_spawner.rb:58:in
`spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
utils.rb:252: in `safe_fork'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
rack/applicat ion_spawner.rb:65:in
`block in spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
rack/applicat ion_spawner.rb:87:in `run'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
utils.rb:323: in
`report_app_init_status'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
rack/applicat ion_spawner.rb:99:in
`block in run'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
utils.rb:416: in `lower_privilege'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
utils.rb:442: in `switch_to_user'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/phusion_passenger/
utils.rb:442: in `switch_user'

-- C level backtrace information
-------------------------------------------
Rack: /home/test-env/current(rb_vm_bugreport+0xbd) [0x816d63d]
Rack: /home/test-env/current [0x81ae1fe]
Rack: /home/test-env/current(rb_bug+0x28) [0x81ae298]
Rack: /home/test-env/current [0x80fbc65]
/lib/libpthread.so.0 [0xb7f3f930]
/lib/libc.so.6 [0xb7e1fe83]
/lib/libc.so.6(initgroups+0x6c) [0xb7e2015c]
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/phusion_passenger/
native_suppor t.so [0xb7cf8be4]
Rack: /home/test-env/current [0x81583c1]
Rack: /home/test-env/current [0x81604f2]
Rack: /home/test-env/current [0x8161c14]
Rack: /home/test-env/current [0x81672a4]
Rack: /home/test-env/current(rb_iseq_eval_main+0x1d3) [0x81675f3]
Rack: /home/test-env/current [0x805e2b2]
Rack: /home/test-env/current(ruby_run_node+0x32) [0x805fb62]
Rack: /home/test-env/current(main+0x60) [0x805d570]
/lib/libc.so.6(__libc_start_main+0xe5) [0xb7da4455]
Rack: /home/test-env/current [0x805d471]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension
libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

*** Exception EOFError in spawn manager (Unexpected end-of-file
detected.) (proc ess 28473):
from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/
phusion_passenger/ utils.rb:374:in
`unmarshal_and_raise_errors'
from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/
phusion_passenger/ rack/
application_spawner.rb:71:in `spawn_application'
from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/
phusion_passenger/ rack/
application_spawner.rb:41:in `spawn_application'
from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/
phusion_passenger/ spawn_manager.rb:
150:in `spawn_application'
from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/
phusion_passenger/ spawn_manager.rb:
278:in `handle_spawn_application'
from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/
phusion_passenger/ abstract_server.rb:
352:in `main_loop'
from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/
phusion_passenger/ abstract_server.rb:
196:in `start_synchronously'
from /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/bin/
passenger-spawn-se rver:61:in `<main>'
[ pid=18366 file=ext/apache2/Hooks.cpp:749 time=2011-03-04
08:17:14.29 ]:
Unexpected error in mod_passenger: Cannot spawn application '/home/
test-env/cu rrent': The spawn server has
exited unexpectedly.
Backtrace:
in 'virtual boost::shared_ptr<Passenger::Application::Session>
Passenger::A
pplicationPoolServer::Client::get(const
Passenger::PoolOptions&)' (ApplicationPo
olServer.h:471)
in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:540)

poseid

unread,
Mar 4, 2011, 9:26:13 AM3/4/11
to sinatrarb
Update: From IRC conversations, this is not a Sinatra problem but Ruby
+Passenger version related:


see the line: /usr/lib/ruby/gems/1.8/gems/passenger-2.2.15/lib/
phusion_passenger/utils.rb:442: [BUG] Segmentation fault

I was using ruby patch level 0, will have to check if a new version
works
Reply all
Reply to author
Forward
0 new messages