你把rails应用程序放在服务器上的哪个位置?你用什么用户部署?

时间:2022-08-26 19:01:00

I've always deployed my apps to ~/apps/myApp/current (with Capistrano, that's why I have the current directory).

我总是将我的应用程序部署到〜/ apps / myApp / current(使用Capistrano,这就是我拥有当前目录的原因)。

But I've seen users deploy to like /var/www/, or even some make a directory at the root, /myapp.

但我已经看到用户部署到/ var / www /,甚至有些人在根目录/ 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.

此外,您通常将您的用户命名为什么,我使用deploy作为我的用户名和组,但我看到用户使用rails或者只是他们总是使用的用户名。

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.

这里有经验法则吗?我知道有些人可能会认为这是一个主观问题,我只想对大多数人做的事情进行一些人口普查。

4 个解决方案

#1


11  

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

    在Ubuntu上,/ srv是安装rails应用程序的好地方。不要把它放在/ var / www中,人们可以在某些情况下浏览你的应用程序源。

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

    用户www-data非常适合运行您的应用程序(运行apache时,这是默认用户)。使用Passenger,您可以在其配置文件中设置PassengerDefaultUser www-data以启用它。不要以root用户身份运行您的应用。这很危险。

#2


2  

/var/rails/app_name/current and deploy

/ var / rails / app_name / current和deploy

#3


1  

I put all my web stuff under /var/www/ just because I like having it all in one place and /var/www/ is the default directory for Apache. There is no 'ideal' place to put your software - just put it wherever seems most logical to you. Pretty much the same for the username - I run my rails stuff under www-data but it doesn't matter what user you run it as (as long as it's not root).

我把我所有的网页内容放在/ var / www /下只是因为我喜欢在一个地方拥有它,而/ var / www /是Apache的默认目录。放置软件没有“理想”的地方 - 只要把它放在最合乎逻辑的地方。对于用户名几乎一样 - 我在www-data下运行我的rails东西但是你运行它的用户并不重要(只要它不是root用户)。

Obviously clients shouldn't be allowed access to the rails app itself.

显然,不应允许客户端访问rails应用程序本身。

#4


1  

/srv is the right place to put your http or ftp , for more info visit https://help.ubuntu.com/community/LinuxFilesystemTreeOverview

/ srv是放置http或ftp的正确位置,有关更多信息,请访问https://help.ubuntu.com/community/LinuxFilesystemTreeOverview

#1


11  

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

    在Ubuntu上,/ srv是安装rails应用程序的好地方。不要把它放在/ var / www中,人们可以在某些情况下浏览你的应用程序源。

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

    用户www-data非常适合运行您的应用程序(运行apache时,这是默认用户)。使用Passenger,您可以在其配置文件中设置PassengerDefaultUser www-data以启用它。不要以root用户身份运行您的应用。这很危险。

#2


2  

/var/rails/app_name/current and deploy

/ var / rails / app_name / current和deploy

#3


1  

I put all my web stuff under /var/www/ just because I like having it all in one place and /var/www/ is the default directory for Apache. There is no 'ideal' place to put your software - just put it wherever seems most logical to you. Pretty much the same for the username - I run my rails stuff under www-data but it doesn't matter what user you run it as (as long as it's not root).

我把我所有的网页内容放在/ var / www /下只是因为我喜欢在一个地方拥有它,而/ var / www /是Apache的默认目录。放置软件没有“理想”的地方 - 只要把它放在最合乎逻辑的地方。对于用户名几乎一样 - 我在www-data下运行我的rails东西但是你运行它的用户并不重要(只要它不是root用户)。

Obviously clients shouldn't be allowed access to the rails app itself.

显然,不应允许客户端访问rails应用程序本身。

#4


1  

/srv is the right place to put your http or ftp , for more info visit https://help.ubuntu.com/community/LinuxFilesystemTreeOverview

/ srv是放置http或ftp的正确位置,有关更多信息,请访问https://help.ubuntu.com/community/LinuxFilesystemTreeOverview