【问题标题】:Virtual host with Passenger带乘客的虚拟主机
【发布时间】:2011-06-05 02:11:17
【问题描述】:

Rails 应用程序已经在 mydomain.com 上使用 Apache+Passenger 正常运行。此外,我将在 blog.mydomain.com 上部署非 Rails 应用程序(wordpress)。所以我修改了 httpd.conf 之类的

PassengerEnabled off
<VirtualHost *:80>
  ServerName mydomain.com
  DocumentRoot /var/www/railsapp/public
  PassengerEnabled on
</VirtualHost>

<VirtualHost *:80>
  ServerName blog.mydomain.com
  DocumentRoot /var/www/blog
</VirtualHost>

但这不起作用。 blog.mydomain.com 还显示了 Rails 应用程序。我该如何划分它们?

【问题讨论】:

  • 运行时得到什么:apachectl -S

标签: ruby-on-rails apache virtual passenger host


【解决方案1】:

尝试将其添加到 conf 文件的顶部:

NameVirtualHost *:80

您也可以尝试交换顺序,以便更具体的顺序优先,但请查看this page 上名为“使用 ServerPath 指令”的部分。这表明对于较旧的 http/1.0 客户端,您可能没有足够的信息来正确路由它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-18
    • 2019-03-01
    • 2012-04-06
    • 1970-01-01
    • 1970-01-01
    • 2015-01-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多