views:

119

answers:

2

Hi all,

This one has got me stumped. I'm deploying a Rails 3 app to Slicehost running Apache 2 and Passenger. My server is running Ruby 1.9.1 using RVM.

I am receiving a permission denied error on the "public" folder in my app. My Virtual Host is setup as follows:

<VirtualHost *:80>

  ServerName  sharerplane.com
  ServerAlias www.sharerplane.com
  ServerAlias *.sharerplane.com

  DocumentRoot /home/robinjfisher/public_html/sharerplane.com/current/public/

  <Directory "/home/robinjfisher/public_html/sharerplane.com/public/">
    AllowOverride all
    Options -MultiViews
    Order allow,deny
    Allow from all
  </Directory>

  PassengerDefaultUser robinjfisher

</VirtualHost>

I've tried the following things: trailing slash on public; no trailing slash on public; PassengerUserSwitching on and off; PassengerDefaultUser set and not set; with and without the block.

The public folder is owned by robinjfisher:www-data and Passenger is running as robinjfisher so I can't see why there are permission issues.

Does anybody have any thoughts?

Thanks

Robin

PS. Have disabled the site for the time being to avoid indexing so what is there currently is not the site in question.

A: 

Check your actual home directory. /home/robinjfisher to ensure its "other" executable bit is set. I.e., the dir has permissions of NN1 or higher where N is whatever you like (i.e., 751 or 701).

jer
It's actually set as 755 at the moment - is this OK? Permissions is a complete mystery to me!
Robin Fisher
Yeah those are perfectly fine. Remember that permissions are represented in base 8, 4 digits, 3 of which are required. They go like this:SUGOWhere S represents setuid/setgid or sticky bits (4, 2 and 1 for values respectively). Setuid/gid bit(s) being set, will set the effective user id / group id to whoever owns the file. Only takes effect when your file is executable. The UGO items are all the same: Read - 4, Write - 2, Execute - 1. Add them up, you get your result. So 755 means that the User can Read, Write and Execute, while the Group and Other can Read and Execute. Hope this helps.
jer
+1  A: 

I found the problem. I had moved some js/css files relating to a plugin and the plugin was then trying to reinstall them as it couldn't find them where it thought they should be.

I commented out the installation code and it works fine now.

Robin

Robin Fisher