Directory listing instead of Rails site after Passenger/REE upgrade

跟風遠走 提交于 2019-12-24 11:04:02

问题


Having updated Passenger and Ruby Enterprise Edition to the latest versions today, I am now seeing a directory listing instead of my Rails app. Here's the Passenger part of my Apache config:

#LoadModule passenger_module /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/passenger-2.1.3/ext/apache2/mod_passenger.so
#PassengerRoot /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/passenger-2.1.3
#PassengerRuby /opt/ruby-enterprise-1.8.6-20090201/bin/ruby

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

RailsEnv production
RackEnv production

PassengerMaxPoolSize 30
PassengerPoolIdleTime 600
PassengerMaxInstancesPerApp 10
PassengerUseGlobalQueue on

This config is definitely being loaded, the vhost is definitely pointing at the public directory of the app. The app itself works fine when run from the Rails console.

You'll see in the config above that the old passenger settings are commented out. If I comment out the new Passenger lines and uncomment out the old ones (i.e. switch to the older version of passenger), the app works fine again.

Tried reinstalling passenger/REE, no difference. There are no relevant entries in the Apache error log or Rails log.

Any help appreciated!


回答1:


I was able to solve this using:

PassengerResolveSymlinksInDocumentRoot

It seems that Passenger no longer handles public directories that are symlinks to your app elsewhere by default. Turning this option on fixed all the issues.




回答2:


I realized that I had /etc/hosts pointing the public URL of my app to 127.0.0.1 for my test callbacks in twitter.

It will simply keep showing a blank file listing. removed the entry from /etc/hosts and everything came back to normal



来源:https://stackoverflow.com/questions/2923588/directory-listing-instead-of-rails-site-after-passenger-ree-upgrade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!