【问题标题】:Phusion passenger and running multiple ruby version with apachePhusion 乘客并使用 apache 运行多个 ruby​​ 版本
【发布时间】:2013-02-01 10:04:55
【问题描述】:

我在 ruby​​ 1.8.x 和 ruby​​ 1.9.11 上分别建立了两个不同的 Rails 网站。我已经使用以下代码行配置了我的 /etc/httpd/conf/http.conf:

LoadModule passenger_module /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/passenger-3.0.18/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/passenger-3.0.18
PassengerRuby /opt/ruby-enterprise-1.8.7-2012.02/bin/ruby

按照
passenger-install-apache2-module

的建议

同样,我还添加了替换替代品的进一步必要代码:

<VirtualHost *:80>
      ServerName www.example.com
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /somewhere/public    
      <Directory /somewhere/public>
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
      </Directory>   
 </VirtualHost>

到目前为止一切正常,但是当我尝试为 ruby​​ 1.9.3 应用程序添加另一个配置并遵循上述相同的过程时,我无法同时运行 ruby​​ 1.8.7 应用程序和 1.9.3 应用程序.后者运行成功,而前者产生错误。

我使用 rvm 来管理这两个应用程序,并为每个应用程序提供单独的 gemset。

所以,我的问题是,如何同时运行我的两个应用程序。

【问题讨论】:

    标签: ruby-on-rails apache passenger


    【解决方案1】:

    Passenger 4 允许为每个应用设置PassengerRuby

    最终版本即将发布,但同时您可以通过gem install passenger --pre 安装它。

    【讨论】:

    • 嗯,很高兴知道
    【解决方案2】:

    您不能在单个 phussion 乘客配置中同时运行多个 ruby​​ 版本。如果是这种情况,那么应该使用独立服务器运行(假设在端口 4000 上),并且您应该将 apache 配置为在该端口上作为代理运行。请参阅http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/ 了解更多信息。

    【讨论】:

    • 这个答案不再有效。检查下一个。
    猜你喜欢
    • 2016-09-27
    • 2011-12-31
    • 1970-01-01
    • 2012-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-19
    • 2015-11-17
    相关资源
    最近更新 更多