如何使用 Phusion Passenger 拥有一个用于开发的虚拟主机和另一个用于生产的虚拟主机?

发布于 2024-12-24 03:32:23 字数 162 浏览 3 评论 0原文

基本上我想根据 URL 在生产或环境模式下访问相同的 Rails 应用程序。这可能吗?如何?

我尝试设置两个不同的虚拟主机,使用不同的 url 和 RailsEnv 值,但这不起作用:Apache 只会为任一 url 提供两个环境之一,更具体地说,是自 Apache 启动以来请求的第一个环境。

Basically I would like to access the same Rails app in production or environment mode depending on the URL. Is this possible? How?

I tried setting up two different virtual hosts, with different urls and values for RailsEnv, but that doesnt work: Apache will only serve one of the two environments for either urls, more specifically the first that was requested since Apache was started.

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

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

发布评论

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

评论(1

回眸一遍 2024-12-31 03:32:23

从 10,000 英尺的高度来看,我猜测 Passenger 通过应用程序的完整文件系统路径在内部跟踪应用程序。所以对于 Passenger 来说,您的两个实例看起来是同一个。

您可以尝试将您的开发虚拟主机指向符号链接 - 这可能会欺骗 Passenger。如果没有,您不能只使用代码的两个不同的签出吗?那肯定会起作用。

At a 10,000ft view, I'm guessing Passenger keeps track of apps internally by their full filesystem paths. So to Passenger, your two instances look like the same one.

You might try pointing your development vhost at a symlink instead - that may trick Passenger. If not, couldn't you just use two different checkouts of your code? That would definitely work.

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