乘客刚刚在 Apache 中显示目录
我正在尝试使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将以下内容放入 apache 配置文件中
Try to put following in apache config file
您可能已将 mod_passenger.so 符号链接到您的 apache2/mods-enabled 目录中。这将解释双重导入。
运行
以删除所有符号链接,然后重新启动 Apache。
You may have mod_passenger.so symlinked into your apache2/mods-enabled directory. This would account for the double import.
Run
to remove any symlink, then restart Apache.