http://qiita.com/naoki_mochizuki/items/5a1757d222806cbe0cd1
このサイトの通りに設定などを進めていましたが、ウェブサイトには404NotFoundoが表示されます。
試したこととしては、
・Unicornの再起動やコードの変更
・Nginxの再起動やコードの変更
error
1/home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:205:in `pid=': Already running on PID:14826 (or pid=/var/www/app/tmp/pids/unicorn.pid is stale) (ArgumentError) 2 from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:137:in `start' 3 from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.3.0/bin/unicorn_rails:209:in `<top (required)>' 4 from /home/user/.rbenv/versions/2.2.2/bin/unicorn_rails:23:in `load' 5 from /home/user/.rbenv/versions/2.2.2/bin/unicorn_rails:23:in `<main>' 6/home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:205:in `pid=': Already running on PID:14826 (or pid=/var/www/app/tmp/pids/unicorn.pid is stale) (ArgumentError) 7 from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:137:in `start' 8 from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/unicorn-5.3.0/bin/unicorn_rails:209:in `<top (required)>' 9 from /home/user/.rbenv/versions/2.2.2/bin/unicorn_rails:23:in `load' 10 from /home/user/.rbenv/versions/2.2.2/bin/unicorn_rails:23:in `<main>' 11
$worker = 2 $timeout = 30 $app_dir = "/var/www/app" $listen = File.expand_path 'tmp/sockets/.unicorn.sock', $app_dir $pid = File.expand_path 'tmp/pids/unicorn.pid', $app_dir $std_log = File.expand_path 'log/unicorn.log', $app_dir # set config worker_processes $worker working_directory $app_dir stderr_path $std_log stdout_path $std_log timeout $timeout listen $listen pid $pid # loading booster preload_app true # before starting processes before_fork do |server, worker| defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! old_pid = "#{server.config[:pid]}.oldbin" if old_pid != server.pid begin Process.kill "QUIT", File.read(old_pid).to_i rescue Errno::ENOENT, Errno::ESRCH end end end # after finishing processes after_fork do |server, worker| defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection end
# log directory error_log /var/www/app/log/nginx.error.log; #自分のアプリケーション名に変更 access_log /var/www/app/log/nginx.access.log; # max body size client_max_body_size 2G; upstream app_server { # for UNIX domain socket setups server unix:/var/www/app/tmp/sockets/.unicorn.sock fail_timeout=0; } server { listen 80; server_name 52.68.32.176 # nginx so increasing this is generally safe... keepalive_timeout 5; # path for static files root /var/www/app/public; # page cache loading try_files $uri/index.html $uri.html $uri @app; location @app { # HTTP headers 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; } # Rails error pages error_page 500 502 503 504 /500.html; location = /500.html { root /var/www/app/public; } }
となっています。Unicorn Nginxの起動は確認できています。
あなたの回答
tips
プレビュー