What deployment directories do you use for Rails applications (deploying to a debian box)?
Asked Answered
V

6

10

I wonder what's the best deployment directory for Rails apps? Some developers use directories such as /u/apps/#{appname}. Are there any advantages when using /u/apps/#{appname} instead of /var/www/#{appname} or other OS default directories?

Obviously I want to pick the directory with the best security properties and the least friction for setting up the server environment.

How do you deploy your Rails apps? Why are you using a specific directory? Do you think it really matters anyway?

Verrucose answered 3/10, 2008 at 11:12 Comment(0)
D
5

As other people have said, it really doesn't matter where you keep your applications - the thing that does matter is that you're consistent about it, so that whichever server you're on, its just a case of going to the usual location.

I think the only reason people use /u/apps/#{appname} is that it's Capistrano's default setting - certainly it seems odd to me doing things that way.

Dasie answered 3/10, 2008 at 12:53 Comment(0)
M
4

FHS standard would suggest /srv/www/#{appname}.

Math answered 26/1, 2009 at 22:57 Comment(1)
and that is exactly where I put it.Hinz
A
3

I tend to create a dedicated user for each rails app I run and install, and add that user to the www-data group. So, I tend to have /home/mephisto/www, /home/warehouse/www and so on.

I do this purely for organization, and I don't think it matters much.

Anaemia answered 3/10, 2008 at 11:30 Comment(1)
I also put my apps in the /home directory, though I put them in /home/rails/<app>.Naturism
L
2

I use Ubuntu and deploy under /var/rails/appname (underneath that are /releases and /current from Capistrano).

I do this to have a little separation between app types: rails, php, static, ...

I don't think it really matters, as long as you set permissions and ownership properly.

Lyophilize answered 3/10, 2008 at 11:33 Comment(0)
E
1

Like the other posters I think you should just put them wherever feels most natural. Read man hier if you'd like to see what directories in the standard UNIX hierarchy are meant for. I like putting things somewhere logical under /var

Another very important consideration is that you should never put your Rails application directory somewhere where RAILS_ROOT will be accessible on the web. So sticking an entire Rails application in the subdirectory of a regular site is a big no-no.

Esemplastic answered 4/10, 2008 at 23:28 Comment(1)
Nice tip on that second paragraph.Anaemia
U
1

The CPanel based shared hosting account I use seems to favour /home/etc/rails_apps/...

I think it's fairly arbitrary - as long as they aren't in your public html directory.

Unseemly answered 28/1, 2009 at 13:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.