简体   繁体   中英

Where to store Rails sites on an Apache server?

I successfully installed passenger on my Apache server and have a rails site running successfully. I'm very new to server management, and I have a very simple question that I can't seem to find an answer to. Where to store my Rails apps? I understand Passanger can reach applications anywhere on the server, so where should the apps be?

I haven't been able to find any one agreed on universal answer to this. Create a user and store in that home dir seems reasonable to me.

Another philosophy is that it should be a systemwide location and there's a reasonable logic behind that too, especially if there are several administrators of the system.

My practice is to install Apache via RPM packages (on CentOS Linux) and deploy Rails apps to Apache's default dir of /var/www/application_name .

Debian's passenger install recommends installing your app to /usr/share/%APP%/ and symlinking the /public dir of the app to /var/www or a subdirectory. I like this method for its cleanliness, though it is a fair bit more work than pretty much every other method out there.

create a user for your apps is a good practice , i will usualy setup a "rails" user .
store the production apps in /home/rails/ remmeber that passenger exec your app with the grant of the files your code belongs!
it's also helpfull if you use rvm.
here an article with some reference

have a nice day

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM