When run cap deploy can create some folders such as releases or shared.What’s the relation between them and Apache or Nginx’s server root?
Is this method right?(This is a Nginx config)
server {
listen 80;
server_name www.yourhost.com;
root /releases/...; # Which path to be here???
passenger_enabled on;
}
And also,after running cap deploy,can web server automatic restart?
When you deploy, capistrano creates a folder in the releases folder, and then symlinks that folder to
/your_app/current.Since the part of your rails app that you expose to the public is the
publicfolder, you need to set the root in your nginx config to:With each deploy the contents of
currentwill effectively be refreshed from the source, any data not committed to the source control would be lost, and this is where the shared folder comes in. The shared folder will contain things which aren’t going to be in the version control, but that you don’t want to lose with each deploy – application logs, uploaded images, etc.Here’s a good example of how to use the shared folder for uploads: http://www.simonecarletti.com/blog/2009/02/capistrano-uploads-folder/
Restarting the web server can be achieved with the following task in your deploy.rb:
Phusion passenger monitors for this file, and will trigger a restart when it’s created.