Добрый день!
Я установил Rails из RVM, поставил Passenger из гемов, установил nginx с подключенным passenger из passenger-install-nginx-module, установил nodejs из репозиториев jessie и получил ошибку: 502 Bad Gateway.
Система имеет 512 Мбайт оперативной памяти. На такой же системе Apache легко запускает подобный сайт.
Конфиг Nginx:
http {
server_names_hash_bucket_size 64;
passenger_root /home/vyacheslav/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.41;
passenger_ruby /home/vyacheslav/.rvm/gems/ruby-2.1.1/wrappers/ruby;
passenger_log_level 3;
passenger_debug_log_file /var/log/passenger.log;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
....
}
server {
listen 80;
server_name fastdevelop.ru www.fastdevelop.ru;
root /home/vyacheslav/www/fastdevelop/public;
passenger_enabled on;
}
Лог nginx:
2014/04/17 13:53:20 [error] 9777#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 5.167.21.254, server: fastdevelop.ru, request: "GET / HTTP/1.1", upstream: "passenger:/tmp/passenger.1.0.9757/generation-0/request:", host: "fastdevelop.ru"
Лог passenger:
[ 2014-04-17 14:02:33.7187 10400/7fcd04f90700 EventedBufferedInput.h:361 ]: [EventedBufferedInput 0x7fccf40037a0 fd=-1, state=LIVE, buffer(0)="", paused=1, socketPaused=1, nextTickInstalled=0, generation=1, error=0] reset()
[ 2014-04-17 14:02:33.7187 10400/7fcd04f90700 EventedBufferedInput.h:381 ]: [EventedBufferedInput 0x7fccf40037a0 fd=24, state=LIVE, buffer(0)="", paused=1, socketPaused=1, nextTickInstalled=0, generation=2, error=0] start()
[ 2014-04-17 14:02:33.7187 10400/7fcd04f90700 agents/HelperAgent/RequestHandler.h:2301 ]: [Client 20] Sending headers to application
[ 2014-04-17 14:02:33.7187 10400/7fcd04f90700 agents/HelperAgent/RequestHandler.h:2447 ]: [Client 20] Begin sending body to application
[ 2014-04-17 14:02:33.7187 10400/7fcd04f90700 agents/HelperAgent/RequestHandler.h:2517 ]: [Client 20] End of (unbuffered) client body reached; done sending data to application
App 10419 stderr: [ 2014-04-17 14:02:33.7189 10530/0x000000015ae758(Main thread) request_handler.rb:181 ]: Entering request handler main loop
App 10419 stderr: [ 2014-04-17 14:02:33.7287 10530/0x000000017123b0(Worker 1) request_handler/thread_handler.rb:131 ]: Accepted new request on socket main socket
App 10419 stderr: [ 2014-04-17 14:02:33.7303 10530/0x000000017123b0(Worker 1) utils.rb:68 ]: *** Exception RuntimeError in Rack application object (Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`) (process 10530, thread 0x000000017123b0(Worker 1)):
App 10419 stderr: from /home/vyacheslav/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/application.rb:440:in `validate_secret_key_config!'
App 10419 stderr: from /home/vyacheslav/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/application.rb:195:in `env_config'
App 10419 stderr: from /home/vyacheslav/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/engine.rb:510:in `call'
App 10419 stderr: from /home/vyacheslav/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0/lib/rails/application.rb:144:in `call'
App 10419 stderr: from /home/vyacheslav/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.41/lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
App 10419 stderr: from /home/vyacheslav/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.41/lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
App 10419 stderr: from /home/vyacheslav/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.41/lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
App 10419 stderr: from /home/vyacheslav/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.41/lib/phusion_passenger/request_handler.rb:448:in `block (3 levels) in start_threads'
App 10419 stderr: [ 2014-04-17 14:02:33.7304 10530/0x000000017123b0(Worker 1) request_handler/thread_handler.rb:153 ]: Request done.
[ 2014-04-17 14:02:33.7305 10400/7fcd04f90700 EventedBufferedInput.h:146 ]: [EventedBufferedInput 0x7fccf40037a0 fd=24, state=LIVE, buffer(0)="", paused=0, socketPaused=0, nextTickInstalled=0, generation=2, error=0] onReadable
[ 2014-04-17 14:02:33.7305 10400/7fcd04f90700 EventedBufferedInput.h:172 ]: [EventedBufferedInput 0x7fccf40037a0 fd=24, state=LIVE, buffer(0)="", paused=0, socketPaused=0, nextTickInstalled=0, generation=2, error=0] end of stream
[ 2014-04-17 14:02:33.7305 10400/7fcd04f90700 agents/HelperAgent/RequestHandler.h:1182 ]: [Client 20] Event: onAppInputData
[ 2014-04-17 14:02:33.7305 10400/7fcd04f90700 agents/HelperAgent/RequestHandler.h:1234 ]: [Client 20] Event: onAppInputEof
[ 2014-04-17 14:02:33.7306 10400/7fcd04f90700 agents/HelperAgent/RequestHandler.h:1241 ]: [Client 20] Application sent EOF
[ 2014-04-17 14:02:33.7306 10400/7fcd04f90700 Pool2/Implementation.cpp:413 ]: Session closed for process (pid=10530, group=/home/vyacheslav/www/fastdevelop#default)
[ 2014-04-17 14:02:33.7306 10400/7fcd04f90700 agents/HelperAgent/RequestHandler.h:1323 ]: [Client 20] Event: onClientOutputPipeEnd
[ 2014-04-17 14:02:33.7306 10400/7fcd04f90700 agents/HelperAgent/RequestHandler.h:1328 ]: [Client 20] Client output pipe ended; disconnecting client
[ 2014-04-17 14:02:33.7306 10400/7fcd04f90700 agents/HelperAgent/RequestHandler.h:644 ]: [Client 20] Disconnected; new client count = 0
[ 2014-04-17 14:02:33.7307 10400/7fcd04f90700 EventedBufferedInput.h:353 ]: [EventedBufferedInput 0x7fccf4001490 fd=20, state=LIVE, buffer(0)="", paused=1, socketPaused=1, nextTickInstalled=0, generation=2, error=0] destroyed
[ 2014-04-17 14:02:33.7307 10400/7fcd04f90700 EventedBufferedInput.h:353 ]: [EventedBufferedInput 0x7fccf40037a0 fd=24, state=END_OF_STREAM, buffer(0)="", paused=1, socketPaused=1, nextTickInstalled=0, generation=2, error=0] destroyed
[ 2014-04-17 14:02:37.0002 10400/7fcd0717f700 Pool2/Pool.h:790 ]: Analytics collection time...
[ 2014-04-17 14:02:38.0113 10400/7fcd0717f700 Pool2/Pool.h:894 ]: Analytics collection done; next analytics collection in 4.989 sec
Спасибо!