rails4/ruby2.0.0p353/nginx/unicorn) with one app. I think unicorn is my
current barrier--nginx seems to be running, waiting to forward responses to
unicorn on :8080, but there's some stock setup I'm not understanding. Do I
need to tweak the *unicorn* run or somehow get *unicorn_rails* working? My
basic capistrano deploy works, at least enough to get the files to the
server. My goal here is at least getting the site running to the point of
postgres errors i.e. the db doesn't yet exist, and that's another challenge.
- DigitalOcean sets up an app at /home/rails out of the box, which runs
fine.
- I updated /etc/nginx/sites-enabled/default (below) to my app's
properties and restarted
- I added config/unicorn.rb to my site and try to restart
unicorn/unicorn_rails/etc, still can't get it right
*/etc/nginx/sites-enabled/default* (my changes)
upstream unicorn {
server unix:/tmp/.sock fail_timeout=0;
}
server {
listen 80;
root /var/www/myapp/current/public;
server_name mysite.com;
index index.htm index.html;
location / {
try_files $uri/index.html $uri.html $uri @app;
}
# location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|ex
e|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mp3|flv|mpeg|avi)$ {
location ~*
^.+\.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tx
t|tar|mid|midi|wav|bmp|rtf|mp3|flv|mpeg|avi)$ {
try_files $uri @app;
}
location @app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app_server;
}
}
*myapp/config/unicorn.rb* (my attempt)
working_directory "/var/www/myapp/current"
listen "/tmp/.sock", :backlog => 64
listen 8080, :tcp_nopush => true
worker_processes 2 # this should be >= nr_cpus
timeout 30
pid "/var/www/myapp/shared/pids/unicorn.pid"
stderr_path "/var/www/myapp/shared/log/unicorn.log"
stdout_path "/var/www/myapp/shared/log/unicorn.log"
*/home/unicorn/unicorn.rb (DO's out of the box config)*
listen "127.0.0.1:8080"
worker_processes 2
user "rails"
working_directory "/home/rails"
pid "/home/unicorn/pids/unicorn.pid"
stderr_path "/home/unicorn/log/unicorn.log"
stdout_path "/home/unicorn/log/unicorn.log"
*tail unicorn.log* (the boldface error log below is what I think happens
when I make a request to the site and I get the public/500.html)
E, [2014-03-14T04:21:28.560329 #12797] ERROR -- : reaped #<Process::Status:
pid 19540 exit 1> worker=1
I, [2014-03-14T04:21:28.560596 #12797] INFO -- : worker=1 spawning...
I, [2014-03-14T04:21:28.562834 #19544] INFO -- : worker=0 spawned pid=19544
I, [2014-03-14T04:21:28.563159 #19544] INFO -- : Refreshing Gem list
I, [2014-03-14T04:21:28.567875 #19546] INFO -- : worker=1 spawned pid=19546
I, [2014-03-14T04:21:28.568298 #19546] INFO -- : Refreshing Gem list
I, [2014-03-14T04:21:28.701987 #12797] INFO -- : reaped #<Process::Status:
pid 19544 exit 0> worker=0
I, [2014-03-14T04:21:28.702374 #12797] INFO -- : reaped #<Process::Status:
pid 19546 exit 0> worker=1
*Exception `Errno::ECHILD' at
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/unicorn-4.7.0/lib/unicorn/http_server.rb:408
- No child processes*
I, [2014-03-14T04:21:28.702857 #12797] INFO -- : master complete
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ab8738d9-0ec8-4ce7-ae25-61249ba1152a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.