Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 708
Christoph Schiessl Avatar asked Oct 03 '08 11:10

Christoph Schiessl


6 Answers

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.

like image 95
Jon Wood Avatar answered Nov 15 '22 22:11

Jon Wood


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

like image 42
Abie Avatar answered Nov 15 '22 22:11

Abie


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.

like image 25
changelog Avatar answered Nov 15 '22 23:11

changelog


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.

like image 26
Daniel Beardsley Avatar answered Nov 15 '22 22:11

Daniel Beardsley


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.

like image 45
Grant Hutchins Avatar answered Nov 15 '22 21:11

Grant Hutchins


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.

like image 28
Noel Walters Avatar answered Nov 15 '22 23:11

Noel Walters