views:

473

answers:

3

I'm not sure how to set permissions for Passenger on OSX. I have gotten through the install fine, but I understand now that Passenger runs as whoever owns environment.rb. That's my own user and group, call it apple & apple. As I understand it, Apache runs as _www & _www. What's the right strategy here? Let's say the app is at

/Users/apple/Documents/projects/my_rails_app

I'm assuming that I don't set the owner and group of everything in that path to _www. And I don't think I can run Apache as apple & apple, right?

Is it a matter of putting myself in the _www group? Or...??

Any help gratefully received.

Dan Donaldson, Toronto

A: 

The app will run as whatever user owns config/environment.rb. The root user is discouraged and may break.

Ryan Bigg
But the question remains for me, with apache running as _www and my files as apple, both in groups named the same, to what do I set permissions to allow the app to run? _www can't access apple files, and presumably I'd have to be _www to edit them as it stands.
Dan Donaldson
no, you're not getting it. Passenger will run the application under whatever user owns it. Try it.
Ryan Bigg
A: 

Things now are running on localhost. The answer is pretty simple: change permissions to the same as apache. The difficulty came because the permissions and ownership have to be the same up to the root of the directory. That was easier to do by using

/Library/Webserver/Documents/my_rails_app

and updating apache.conf to reflect same.

Dan Donaldson
That's basically beating your system into submission. You shouldn't have to do that. Something is wrong with your Passenger configuration, and/or Apache wasn't started as root so `suexec` won't work.
SFEley
A: 

You shouldn't have to do anything, assuming your Passenger installation is clean (i.e., you've reinstalled it and reconfigured the config files since upgrading to Snow Leopard) and you haven't messed with the defaults. User switching is supposed to be enabled by default, and the Passenger process that runs your application should automatically suexec to your own user account.

If it isn't working that way, check to make sure you're using OS X's built-in Apache server and then double-check everything in your Passenger configuration. You can look to their site for some support as well.

SFEley