【发布时间】:2010-02-02 00:40:15
【问题描述】:
我正在http://www.naildrivin5.com/scalatour 上运行一个 Rails 应用程序。它工作正常。当我使用restful_authentication 登录应用程序时,我被带到http://www.naildrivin5.com 而不是应用程序。奇怪的。
这似乎是我配置错误。此外,我在一些地方手动创建了一些 url,我需要访问“应用程序上下文根”(即在我的情况下为 scalatour)以正确形成 URL。我最终把它扔进了我的配置中,但这似乎是错误的。
Apache 和 Passenger 一起运行 Rails 应用程序:
Apache 配置:
<VirtualHost 69.89.3.135:80>
DocumentRoot /somewhere/naildrivin5.com/html
ServerName naildrivin5.com
RailsBaseURI /scalatour
PassengerPoolIdleTime 5
# other things not related
</VirtualHost>
passenger.conf:
LoadModule passenger_module /usr/share/passenger/ext/apache2/mod_passenger.so
PassengerRoot /usr/share/passenger
PassengerRuby /usr/bin/ruby
PassengerLogLevel 2
/somewhere/naildrivin5.com/html/scalatour 符号链接到我的 Rails 应用程序的 public 文件夹。
该应用运行良好,除了使用restful_authentication进行身份验证。登录后,我会转到 Web 服务器根目录,而不是应用程序根目录。
我应该/可以如何配置它,如何在运行时访问它,以及如何最好地配置我的本地开发环境来执行此操作(或不关心它)?
【问题讨论】:
标签: ruby-on-rails apache ruby-on-rails-plugins passenger