我正在尝试使用Apache(2.4.17),rvm和passenger(4.0.59)将Rails 4.1.0应用程序部署到我的生产环境中。
问题是,当我进入我的虚拟主机的URL(www.myapp.com)时,我不断获得公共目录的apache目录列表。但是:当我导航到rails-app内的路线时,例如;www.myapp.com/pages/1
乘客启动了应用程序,一切正常。
这是我的passenger.conf:
# /etc/apache2/conf-enabled/passenger.conf
LoadModule passenger_module /home/sander/.rvm/gems/ruby-2.1.0-preview2/gems/passenger-4.0.59/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/sander/.rvm/gems/ruby-2.1.0-preview2/gems/passenger-4.0.59
PassengerDefaultRuby /home/sander/.rvm/gems/ruby-2.1.0-preview2/wrappers/ruby
</IfModule>
我检查了apache模块是否已加载:
>> apache2ctl -M
...
passenger_module (shared)
虚拟主机配置:
<VirtualHost my-ip:80>
ServerName www.myapp.com
ServerAlias myapp.com
DocumentRoot /srv/www/rails/myapp/current/public
PassengerAppRoot /srv/www/rails/myapp/current
RailsEnv production
<Directory /srv/www/rails/myapp/current/public>
Require all granted
Options -MultiViews
</Directory>
</VirtualHost>
任何帮助都非常感谢。
这个关于serverfault的答案现在帮助我解决了这个问题:https : //serverfault.com/questions/731814/apachepassenger-not-serving-the-root-of-the-sinatra-application
Kami结合了Phusion Passenger引用了自动索引模块中Apache 2.4.17中的一个错误。
我通过注释以下Loadmodule ...
行来禁用了自动索引模块/etc/apache2/mods-enabled/autoindex.load
重新启动了Apache,现在一切正常。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句