Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do you put your rails app on your server? What User do you deploy with?

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.

like image 362
JP Silvashy Avatar asked Sep 08 '10 02:09

JP Silvashy


People also ask

How do I run the Rails app server?

Go to your browser and open http://localhost:3000, you will see a basic Rails app running. You can also use the alias "s" to start the server: bin/rails s . The server can be run on a different port using the -p option. The default development environment can be changed using -e .


2 Answers

  • 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.

like image 55
Nicolas Viennot Avatar answered Nov 10 '22 08:11

Nicolas Viennot


/var/rails/app_name/current and deploy

like image 29
David Lyod Avatar answered Nov 10 '22 10:11

David Lyod