Quantcast
Channel: BitNami Answers - latest questions
Viewing all articles
Browse latest Browse all 2052

error 503: Can't deploy rails 3 app with apache + thin (bitnamy ruby stack)

$
0
0

As you'll notice, I'm a bit of a noob on Rails. Here's the thing

I have a EC2 Bitnami RubyStack AMI running. I'm trying to deploy the sample project to be sure I'm doing the right thing, but I'm not getting anywhere at all. I just get a 503 error

I'm following bitnami's docs on thin + apache

Here are my files:

the httpd.conf I include in the main httpd.conf

Alias /sample "/home/bitnami/stack/projects/sample/public"
<Directory "/home/bitnami/stack/projects/sample/public">
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>

ProxyPass /sample balancer://appcluster
ProxyPassReverse /sample balancer://appcluster<Proxy balancer://appcluster>
   BalancerMember http://127.0.0.1:3000/sample
   BalancerMember http://127.0.0.1:3001/sample</Proxy>

the thin.yml file

chdir: /opt/bitnami/projects/sample
environment: production
address: 127.0.0.1
port: 3000
timeout: 30
log: log/thin.log
pid: tmp/pids/thin.pid
max_conns: 1024
max_persistent_conns: 512
require: []
wait: 30
servers: 2
prefix: /sample
daemonize: true

I'm able to start and stop apache, but thin does not stop correctly though. When I try to stop thin, I get this output

/opt/bitnami/projects/sample$ sudo thin -C config/thin.yml stop
Stopping server on 127.0.0.1:3000 ... 
Can't stop process, no PID found in tmp/pids/thin.3000.pid
Stopping server on 127.0.0.1:3001 ...

I've tried to use nginx as well, without any luck unfortunately.

EDIT: This answers the comment below. Apache is started and thin is too, but the latter does not stop.

/opt/bitnami/projects/sample$ sudo /opt/bitnami/ctlscript.sh restart apache
Syntax OK
/opt/bitnami/apache2/scripts/ctl.sh : httpd stopped
Syntax OK
/opt/bitnami/apache2/scripts/ctl.sh : httpd started at port 80
/opt/bitnami/projects/sample$ sudo thin -C config/thin.yml startStarting server on 127.0.0.1:3000 ... 
Starting server on 127.0.0.1:3001 ... 
/opt/bitnami/projects/sample$ sudo thin -C config/thin.yml stop
Stopping server on 127.0.0.1:3000 ... 
Can't stop process, no PID found in tmp/pids/thin.3000.pid
Stopping server on 127.0.0.1:3001 ... 
Can't stop process, no PID found in tmp/pids/thin.3001.pid

EDIT 2: I'm adding the thin.3000.log

Writing PID to tmp/pids/thin.3000.pid Using rack adapter Thin web server (v1.4.1 codename Chromeo) Maximum connections set to 1024 Listening on 0.0.0.0:3000, CTRL+C to stop Exiting!

/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/thin/backends/tcp_server.rb:16:in `connect': cannot load such file -- thin/connection (LoadError)
        from /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/thin/backends/base.rb:55:in `block in start'
        from /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `call'
        from /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run_machine'
        from /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run'
        from /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/thin/backends/base.rb:63:in `start'
        from /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/thin/server.rb:159:in `start'
        from /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:86:in `start'
        from /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:185:in `run_command'
        from /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:151:in `run!'
        from /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/thin-1.4.1/bin/thin:6:in `<top (required)>'
        from /opt/bitnami/ruby/bin/thin:23:in `load'
        from /opt/bitnami/ruby/bin/thin:23:in `<main>'

production.log is empty

Would it help if I reinstall thin?

EDIT 3: I reinstalled thin. I'm getting the same errors. Plus, the thin pid files are being written and deleted to the corresponding directory.


Viewing all articles
Browse latest Browse all 2052

Trending Articles