これでもダメでした $ 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...
=======================================
http://ift.tt/1abnmbU
May 06, 2016 at 04:18PM
=======================================
これでもダメでした
$ 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
=====================================================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
コメント
コメントを投稿