问题
Here is the code in deploy.rb
set :application, "myapp"
server "10.15.169.45", :web, :app, :db, :primary => true
What's the URL accessing the web app after deployment? Tried http://10.15.169.45 and http://10.15.169.45/myapp and none of them worked. http://10.15.169.45 displayed "Welcome to nginx".
Any suggestions? thanks.
回答1:
Capistrano just posts the files to the server, and runs some additional tasks (if you tell it to). It is not responsible for serving the page. Given that you said that you have passenger + nginx setup, I would go there first for troubleshooting. Assuming you configured everything properly according to the passenger instructions, with the standard setup the app should be available on 10.15.169.45.
The message you are getting indicates that nginx is installed correctly, but either passenger is not configured properly, or your rails app has not been started. You should check the nginx logs, and walk back through your configuration steps to see if there is anything that you missed.
You should also check out the passenger documentation on integrating with capistrano: http://modrails.com/documentation/Users%20guide%20Nginx.html#capistrano
回答2:
Do you have a Rails application server installed? What does your Nginx configuration look like?
In case you haven't set something like this up already, I would highly recommend Phusion Passenger. It works with Apache or Nginx, is well documented, and is easy to install and configure.
来源:https://stackoverflow.com/questions/7987574/whats-the-url-for-rails-app-deployed-by-capistrano