Getting Radiant rolling on a fresh Dapper install with Deprec

Hi folks,

Slicehost gets a good press around here, so I’ve decided to try them
out for my latest Radiant site.

Starting from a fresh Ubuntu Dapper installation, I used deprec to
install the Rails stack. I have been able to get a pure Rails app up
and running, but when I try the same procedure with a Radiant site I
am unsuccessful. I’m issuing the following commands:

[1]: deprec --apply-to .
(edit :domain. :application, and :user in config/deploy.rb)
[2]: cap1 setup_ssh_keys
[3]: cap1 install_rails_stack
[4]: cap1 deprec_setup
[5]: cap1 setup_scm
(cd to the newly created working copy of project)
[6]: cap1 deploy_with_migrations
[7]: cap1 restart_apache

Commands 1-5 all work fine, but then it goes awry. Command [6]
objects, because the radiant gem has not been installed on the
server. I realise it should be straightforward to add a capistrano
task to do this, but I’m not sure how, so I just logged into the
server again and ran:

sudo gem install -v=0.6.3 radiant

My site uses the Sass extension, so I also ran:

sudo gem install haml

Following these modifications, commands [6] & [7] seemed to work
fine, but my site doesn’t run.

On the server, I tried this:

curl -I http://127.0.0.1:8000
HTTP/1.1 500 Internal Server Error
Connection: close
Date: Sun, 02 Dec 2007 19:34:50 GMT
Status: 500 Internal Error
Last-Modified: Sun, 02 Dec 2007 19:34:50 GMT
Server: Mongrel 1.1.1
Content-Type: text/html; charset=utf-8
Content-Length: 15518

If I run the same command without the -I flag, then I get HTML
source for what appears to be a Rails error page. Here are the first
lines:

Errno::EACCES in SiteController#show_page

Permission denied - /var/www/apps/nomore/current/cache/
index.data

RAILS_ROOT: /var/www/apps/nomore/current/config/..

Could anyone suggest what I might attempt to solve this?

Thanks in advance.


I note that on the Radiant wiki there are How Tos for deployment on a
number of hosts, but nothing to walk you through from a fresh Ubuntu
LTS install. I’ve been taking notes on what I’m doing, and will
happily turn them into a How To as soon as I get up and running.

Seeing the error message “Permission denied -
/var/www/apps/nomore/current/cache/index.data” seems that you have
exactly
that, an access permission problem (at least) to the Radiant cache
directory.

The easiest way to solve this is to try a “chmod a+w -R”, on
/var/www/apps/nomore/current/cache/ . But be aware of security issues.

/AITOR

The easiest way to solve this is to try a “chmod a+w -R”, on /var/
www/apps/nomore/current/cache/ .

OK, I tried that and it worked. So that appears to have sourced the
problem.

But be aware of security issues.

Indeed. Here is the output from running ‘ls -al’ from my app
directory on the server (after resetting permissions with “chmod 775
cache”):

drwxrwxr-x 3 deploy deploy 4096 Dec 5 23:09 cache
drwxrwxr-x 4 deploy deploy 4096 Dec 5 23:09 config
drwxrwxr-x 3 deploy deploy 4096 Dec 5 23:09 db
drwxrwxr-x 7 deploy deploy 4096 Dec 5 23:09 public
drwxrwxr-x 5 deploy deploy 4096 Dec 5 23:09 script
drwxrwxr-x 6 deploy app_nomore 4096 Dec 5 23:09 tmp
drwxrwxr-x 5 deploy deploy 4096 Dec 5 23:09 vendor

I notice that the tmp/ directory has different ownership group from
all other directories. So I tried running “sudo chgrp app_nomore
cache/”, which changed to:

drwxrwxr-x 3 deploy app_nomore 4096 Dec 5 23:09 cache

drwxrwxr-x 6 deploy app_nomore 4096 Dec 5 23:09 tmp

Which also works. Does this avoid the security issues mentioned above?

I guess I just have to work out how to add that command to my
deploy.rb file as a capistrano task now.

Thanks for the tip Aitor!

Drew

The important thing is that the Radiant (Rails) process must have write
permissions to that directory. Both the chmod and chgrp do the job.
For me
seems that the chgrp you did is more clean. Security is a though topic,
but
in your case i wouldn’t be worried too much, it’s just the temp
directory.

/AITOR

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs