This is the configuration of capistrano to deploy an application on Site5
when we have the code in a repository subversion. Possibly be used in other shared servers with slight modifications. To write this post I have made a real deployment of an application, I have consulted the tutorial I found on http://www.thebitguru.com/articles/9-Setting+up+Capistrano+on+Site5 and I used the media technicians
(this point is specific Site5 Set the development environment: from a subdirectory of your application rails run cap - apply-to. This command will APP_NAME
: config exists
-
create config / deploy.rb exists lib / tasks create lib / tasks / capistrano.rake
set: repository, "svn + ssh: / / USER @ DOMAIN / RUTA_DEL_REPOSITORIO" Put the addresses of each role in your application (web, app, db) . Typically only used: web and: app by putting the domain name (eg "bee.com.es").
Uncomment the line "deploy_set" indicating the correct path to the subdirectory on the server where you want to install the application, eg
set: deploy_to, "/ home / TU_USERNAME / apps / # {application}"
If
set: user, "TU_USERNAME"
Add the following capistrano tasks to bottom:
desc "Link in the production database.yml and fix permissions" task
run" find # {release_path} / public-type f-exec chmod 0644 {} \\ \\; "
run" chmod 0755 # {release_path} / public / dispatch. * " run" chmod 755 # {current_path} / public / dispatch.fcgi " run" touch # {current_path} / public / dispatch. fcgi " end
Configure the server: Run from the root of the application setup command
- cap line Change public / .htaccess: RewriteRule
Dispatch.cgi ^(.*)$ [QSA, L]RewriteRule ^(.*)$ dispatch.fcgi [QSA, L] Note that
by:
only change the extension. Cgi by. Fcgicap deploy command
Ready! now to deploy your application just run from the root of the application - Possible errors:
If the protocol in your subversion repository is svn + ssh, ie you have to use ssh ask you to make perimiter ssh from the server because by default it is disabled.
0 comments:
Post a Comment