これでもダメでした $ sudo mkdir /var/run/unicorn $ sudo chmod 777 /var/run/unicorn $ sudo vi config/unicorn.rb =====================================================application = "myapp1" worker_processes = 2 working_directory "/home/vagrant/railsapp/#{application}" listen "/var/run/unicorn/unicorn_#{application}.sock" pid "/var/run/unicorn/unicorn_#{application}.pid" stderr_path "/home/vagrant/railsapp/#{application}/log/unicorn.stderr.log" stdout_path "/home/vagrant/railsapp/#{application}/log/unicorn.stdout.log" preload_app true ===================================================== $ sudo vi /etc/nginx/conf.d/default.conf =====================================================upstream unicorn-unix-domain-socket { server unix:/var/run/unicorn/unicorn_myapp1.sock fail_timeout=0; } upstream unicorn-tcp { server 127.0.0.1:3000; } server { listen 80; server_name localhost; root /home/[railsapp]/public; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { proxy_pass http://unicorn-unix-domain-socket; } } ===================================================== $ sudo service nginx restart

これでもダメでした $ sudo mkdir /var/run/unicorn $ sudo chmod 777 /var/run/unicorn $ sudo vi config/unicorn.rb...
=======================================
これでもダメでした


$ sudo mkdir /var/run/unicorn
$ sudo chmod 777 /var/run/unicorn
$ sudo vi config/unicorn.rb
=====================================================application = "myapp1"

worker_processes = 2
working_directory "/home/vagrant/railsapp/#{application}"

listen "/var/run/unicorn/unicorn_#{application}.sock"
pid "/var/run/unicorn/unicorn_#{application}.pid"

stderr_path "/home/vagrant/railsapp/#{application}/log/unicorn.stderr.log"
stdout_path "/home/vagrant/railsapp/#{application}/log/unicorn.stdout.log"

preload_app true
=====================================================

$ sudo vi /etc/nginx/conf.d/default.conf
=====================================================upstream unicorn-unix-domain-socket {
server unix:/var/run/unicorn/unicorn_myapp1.sock fail_timeout=0;
}

upstream unicorn-tcp {
server 127.0.0.1:3000;
}

server {
listen 80;
server_name localhost;

root /home/[railsapp]/public;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location / {
proxy_pass http://unicorn-unix-domain-socket;
}
}
=====================================================
$ sudo service nginx restart

http://ift.tt/1abnmbU
May 06, 2016 at 04:18PM

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)