【问题标题】:Passenger just showing directory in Apache乘客只是在 Apache 中显示目录
【发布时间】:2011-11-06 22:58:34
【问题描述】:

我正在尝试使用Passenger 在带有Apache 的Ubuntu 上部署一个rails 应用程序。我已经遵循了几乎所有关于使用 Apache/Ubuntu 配置Passenger 的指南。但是,当我访问该站点时,我只看到实际的文件目录,而不是应用程序的运行版本。如果我切换到 /public 目录,当我访问该站点时,我只会看到公共目录。我可以通过调用rails s 来启动和停止rails 服务器而不会出现任何错误,但仍然无法看到应用程序的运行版本。有没有人遇到过类似的问题?有没有人可以建议我看的一个好的起点?我不确定问题出在 apache 上还是乘客上。

Apache 配置

 LoadModule passenger_module /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
 PassengerRuby /usr/bin/ruby
 PassengerRoot /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.9
 PassengerMaxPoolSize 10
 <VirtualHost *:80>
     ServerName http://www.myapp.com/
     DocumentRoot /var/www/myapp/current/
<Directory /var/www/myapp/current/public>
    Allow from all
</Directory>

当我重新启动 apache 时,我收到一条消息,指出 [Sun Nov 06 14:43:48 2011] [warn] module passenger_module is already loaded, skipping 我不确定这是错误还是正常。

更新

当我运行find / -name 'mod_passenger.so' 时,我得到两个位置: /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.9/ext/apache2/mod_passenger.so /usr/lib/apache2/modules/mod_passenger.so

更新 2

我有几个passenger.config 文件

 /etc/apache2/mods-enabled/passenger.conf
 /etc/apache2/mods-available/passenger.conf
 /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.9/debian/passenger.conf

每个passenger.conf 文件都有以下内容:

 <IfModule mod_passenger.c>
      PassengerRoot /usr
      PassengerRuby /usr/bin/ruby
 </IfModule>

【问题讨论】:

    标签: ruby-on-rails-3 ubuntu apache2 passenger


    【解决方案1】:

    尝试将以下内容放入 apache 配置文件中

    <Directory /var/www/myapp/current/public>
        Allow from all
        #Add following line
        Options +Includes -Indexes
    </Directory>
    

    【讨论】:

      【解决方案2】:

      您可能已将 mod_passenger.so 符号链接到您的 apache2/mods-enabled 目录中。这将解释双重进口。

      运行

      a2dismod mod_passenger.so
      

      删除任何符号链接,然后重新启动 Apache。

      【讨论】:

        猜你喜欢
        • 2013-06-03
        • 2014-11-01
        • 2016-01-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多