乘客刚刚在 Apache 中显示目录

发布于 2024-12-14 12:06:59 字数 1504 浏览 5 评论 0原文

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

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已经加载,正在跳过 我不确定这是否是一个错误或者是正常的。

更新

当我运行 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>

I am trying to use Passenger to deploy a rails app on Ubuntu with Apache. I've followed pretty much every guide I could find on configuring Passenger with Apache/Ubuntu. However, when I go to the site, I just see the actual file directories and not the running version of the application. If i switch to the /public directory I just see the public directory when I go to the site. I can start and stop the rails server by calling rails s without getting any errors, but still am not able to see the running version of the application. Does anyone ran into similar problems? Is there a good starting point anyone could suggest I look at? I'm not sure if the problem is with apache or passenger.

Apache config

 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>

When I restart apache, I get a message stating [Sun Nov 06 14:43:48 2011] [warn] module passenger_module is already loaded, skipping I'm not sure if this is an error or is normal.

Update

When I run find / -name 'mod_passenger.so' I get two locations:
/usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
/usr/lib/apache2/modules/mod_passenger.so

Update 2

I have several passenger.config files

 /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

Each of the passenger.conf files has the following:

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

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

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

发布评论

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

评论(2

小姐丶请自重 2024-12-21 12:06:59

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

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

Try to put following in apache config file

<Directory /var/www/myapp/current/public>
    Allow from all
    #Add following line
    Options +Includes -Indexes
</Directory>
并安 2024-12-21 12:06:59

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

运行

a2dismod mod_passenger.so

以删除所有符号链接,然后重新启动 Apache。

You may have mod_passenger.so symlinked into your apache2/mods-enabled directory. This would account for the double import.

Run

a2dismod mod_passenger.so

to remove any symlink, then restart Apache.

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