在 RoR 中配置多个应用程序

发布于 2024-10-08 16:05:08 字数 383 浏览 0 评论 0原文

我想要多个可以相互通信的 RoR 应用程序(数据库、方法调用……)。

我想要的示例:

  • 在 URL http:// www.< 上运行的主应用程序application_name > .com
  • 在 URL http:// www 上运行的子应用程序 1。 application1_name >.< application_name > .com
  • 在 URL http:// www 上运行的子应用程序 2。 application2_name >.< application_name >.com

每个都有自己的数据库。

我如何配置我的应用程序?在哪里可以找到满足我需求的教程?

I would like to have multiple RoR applications that can communicate with each other (databases, method calls, ...).

Example of what I would like:

  • a main application running on a URL http:// www.< application_name >.com
  • a sub-application 1 running on a URL http:// www.< application1_name >.< application_name >.com
  • a sub-application 2 running on a URL http:// www.< application2_name >.< application_name >.com

each with own databases.

How can I configure my applications? Where can I find a tutorial for my needs?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

嘿看小鸭子会跑 2024-10-15 16:05:08

没问题。在您的情况下,您将拥有 3 个不同的 Rails 应用程序。您将设置 Web 服务器以根据访问三个应用程序之一的主机发送请求。这是标准的 Web 服务器配置。您需要阅读 Apache 或 Nginx 配置,了解如何将请求路由到正确的 Rails 应用程序。

编辑:

http://articles.slicehost.com /2009/3/11/ubuntu-intrepid-nginx-rails-and-mongrels
不确定您将使用什么作为您的 Web 服务器(Apache 或 Nginx 或其他)或您将使用什么作为您的应用程序容器(mongrel/passenger/thin 等),但上面的这篇文章应该有所帮助。

No Problem. In your case you will have 3 distinct Rails applications. You will setup your Webserver to send requests based on host accessed to one of the three applications. This is standard web server configuration. You'll need to read Apache or Nginx configuration on how to route request to the right rails application.

EDIT:

http://articles.slicehost.com/2009/3/11/ubuntu-intrepid-nginx-rails-and-mongrels
Not sure what you are going to use as your Web Server (Apache or Nginx or something else) or what you are going use as your application container (mongrel/passenger/thin etc) but this article above should help.

鹊巢 2024-10-15 16:05:08

您可以查看 eco_apps gem - https://github.com/idapted/eco_apps。我听说开发人员在 Rails Conf '10 上对此进行了演讲。令人着迷的东西,虽然我还没有机会使用它。

You might take a look at the eco_apps gem - https://github.com/idapted/eco_apps. I heard the developers give a talk about it at Rails Conf '10. Fascinating stuff, though I haven't had a chance to use it yet.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文