Question

How do I figure out what is wrong?

  • Posted August 23, 2013

I followed the tutorial on railscasts.com concerning deployment to a VPS and got after a couple adjustments ran cap deploy:setup and cap deploy:cold without getting back any errors. I ssh’d into my droplet and restarted both Unicorn and Nginx but now i get a “can’t establish connection error.”

In the past I would use cpanel to take a look at the logs to see what error was being thrown…is there a way to check why my site is down?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I believe you have to edit your virtualhost’s config and unicorn’s config to point to /home/root/apps/contests/current <br> <br>Check unicorn’s error logs, do you see anything?

woo hoo! getting closer (i think) <br> <br>*** [err :: 192.241.194.172] /etc/init.d/unicorn_contests: 25: kill: <br>*** [err :: 192.241.194.172] No such process <br>*** [err :: 192.241.194.172] <br>*** [err :: 192.241.194.172] Couldn’t reload, starting ‘cd /home/rails/current/current; bundle exec unicorn -D -c /home/rails/current/current/config/unicorn.rb -E production’ instead <br>*** [err :: 192.241.194.172] master failed to start, check stderr log for details <br> command finished in 3978ms <br>failed: “/bin/bash --login -c ‘/etc/init.d/unicorn_contests restart’” on 192.241.194.172

@cj.miyake: You should deploy it to /home/rails instead, I’m not sure if that railscasts video covers that though.

Well it looks like my rails app is installed to root@estimaterer:/home/root/apps/contests/current per capistrano and git instructions… <br>While there is still the rails app installed to root@estimaterer:/home/rails. <br>I’m guessing the site is trying to run the app in the home/rails setup. Do i have to delete the original rails installation?

there is nothing in the error log. man this is frustrating!

Hmm weird. Is there anything in nginx’s error logs? <br> <br><pre>tail /var/log/nginx/error.log</pre> <br> <br>Also check unicorn’s error logs, it should be in the “stderr_path” directive in unicorn.rb.

root@estimaterer:~# service nginx start <br>Starting nginx: nginx. <br>root@estimaterer:~# sudo netstat -plutn | grep :80 <br>tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 7299/unicorn.conf <br>root@estimaterer:~# <br> <br>and yes I am running all commands as root.

@cj.miyake: What’s the output of <code>sudo netstat -plutn | grep :80</code> after you started nginx? <br> <br>Unicorn is failing to start – are you running the start command as root? <br> <br>I’m really glad to help! :]

Kamal…thank you so much for the help on this. My knowledge of VPS and deployment is obviously very much lacking and I really appreciate the help.

@estimaterer:~# sudo service nginx start <br>Starting nginx: nginx. <br>@estimaterer:~# tail /var/log/nginx/error.log <br> <br>when I typed that in nothing popped up. when i tried starting unicorn… <br>@estimaterer:~# service unicorn start <br> * Starting Unicorn web server unicorn master failed to start, check stderr log for details <br> [fail] <br> <br>