views:

33

answers:

3

I've always deployed my apps to ~/apps/myApp/current (with Capistrano, that's why I have the current directory).

But I've seen users deploy to like /var/www/, or even some make a directory at the root, /myapp.

I'm wondering is there an ideal place to put my app? Or does it not matter at all.

Additionally what do you usually name your user, I'm using deploy as my username and group, but I've seen users use rails or just whatever the username they always use is.

Is there a rule of thumb here? I'm aware that some may see this as a subjective question, I just wanted to get a little census as to what most people do.

+2  A: 
  • On Ubuntu, /srv is a good place to install a rails app. Do not put it in /var/www, people would be able to browse your app sources in some circumstances.

  • The user www-data is perfect for running your app (when running apache, that's the default user). With Passenger, you can set PassengerDefaultUser www-data in its config file to enable that.
    Do NOT run your app in as root. It's very dangerous.

Nicolas Viennot
It seems like running sites in `/var/www` is pretty standard, perhaps I'll create a directory at `/var/rails/myApp` or something.
Joseph Silvashy
Why is `/srv` a good place?
jpartogi
@jpartogi https://lists.ubuntu.com/archives/ubuntu-users/2009-March/176239.html
Nicolas Viennot
+1  A: 

I put all my web stuff under /var/www/ just because I like having it all in one place and /var/www/ is the default directory for Apache. There is no 'ideal' place to put your software - just put it wherever seems most logical to you. Pretty much the same for the username - I run my rails stuff under www-data but it doesn't matter what user you run it as (as long as it's not root).

Obviously clients shouldn't be allowed access to the rails app itself.

Josh
+1  A: 

/var/rails/app_name/current and deploy

David Lyod