简体   繁体   English

在Apache服务器上的哪里存储Rails站点?

[英]Where to store Rails sites on an Apache server?

I successfully installed passenger on my Apache server and have a rails site running successfully. 我已经在我的Apache服务器上成功安装了passenger,并且有一个Rails站点成功运行。 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? 在哪里存储我的Rails应用程序? I understand Passanger can reach applications anywhere on the server, so where should the apps be? 我知道Passanger可以访问服务器上任何位置的应用程序,那么这些应用程序应该在哪里?

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 . 我的做法是通过RPM软件包(在CentOS Linux上)安装Apache,并将Rails应用程序部署到Apache的默认目录/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. Debian的乘客安装建议将您的应用程序安装到/ usr / share /%APP%/,并将应用程序的/ public目录符号链接到/ var / www或子目录。 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 . 为您的应用程序创建用户是一个好习惯,我通常会设置一个“ rails”用户。
store the production apps in /home/rails/ remmeber that passenger exec your app with the grant of the files your code belongs! 将生产应用程序存储在/ home / rails /提醒下,乘客可以通过授予代码所属的文件来执行您的应用程序!
it's also helpfull if you use rvm. 如果您使用rvm,它也很有帮助。
here an article with some reference 这里有一些参考的文章

have a nice day 祝你今天愉快

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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