Caching and Capistrano


#1

I had an incredibly difficult time getting this to work correctly and I
have a couple of comments/questions, after the fact.

When using caching and Capistrano together, how have you set the
permissions on your RAILS_ROOT/public folder…or have you sent your
cache data to your document root? I’ve got it working now, but of
course, it will break the next time I deploy.

I was thinking a about writing a Capistrano task that would create the
folder structure that I need and then setting the correct permissions.
The folder structure was unable to be created on it’s own. Admittedly
so, I’m not very good with Linux and permissions, but maybe there’s a
really simple was around it.

Any feedback would be welcome.


#2

On Fri, Mar 24, 2006 at 05:16:06PM -0000, Joshua S. wrote:

I had an incredibly difficult time getting this to work correctly and I
have a couple of comments/questions, after the fact.

When using caching and Capistrano together, how have you set the
permissions on your RAILS_ROOT/public folder…or have you sent your
cache data to your document root? I’ve got it working now, but of
course, it will break the next time I deploy.

I use something like that in my deploy.rb:

task :after_update_code do
run “/bin/chgrp -R www-data #{release_path}/public”
run “/bin/chmod -R g+w #{release_path}/public”
end

after checking out the last version, this changes group ownership of
the public folder to www-data (the group the web server runs as) and
grants group write permissions, so cache files may be written by the
server.

hth,
Jens