我使用Rails 3.2和Ruby 1.9.3并配置了configure.yml
文件,在EC2服务器上安装了rubyCAS Server
server: webrick
port: 9292
ssl_cert: /mnt/rubyonrails/testingcas.pem
注意:我在生成自签名的SSL'
时提到了域名fortestingonly.managemyasc.devserver
database:
adapter: mysql2
database: casserver
username: root
password: XXXXX
host: localhost
reconnect: true
authenticator:
class: CASServer::Authenticators::SQL
database:
adapter: mysql2
database: mmx_dev
username: root
password: XXXXX
host: localhost
user_table: userdemo
username_column: username
password_column: password
我还将本地/etc/host
中的CAS服务器URL映射为184.72.242.142 fortestingonly.managemyasc.devserver
和在环境文件中: :cas_base_url => "https://fortestingonly.managemyasc.devserver:9292"
现在,我已经启动了RubyCas服务器和应用程序服务器,但是当我尝试访问应用程序URL时,在应用程序日志中遇到了以下错误:
Started GET "/" for 122.162.49.205 at 2014-01-31 04:01:14 -0800
Processing by DashboardController#index as HTML
Guessed service url: "http://ohio-ortho.managemyasc.devserver:3000/"
Generated login url: https://fortestingonly.managemyasc.devserver:9292/login? service=http%3A%2F%2Fohio-ortho.managemyasc.devserver%3A3000%2F
Redirecting to "https://fortestingonly.managemyasc.devserver:9292/login?service=http%3A%2F%2Fohio-ortho.managemyasc.devserver%3A3000%2F"
Redirected to https://fortestingonly.managemyasc.devserver:9292/login?service=http%3A%2F%2Fohio-ortho.managemyasc.devserver%3A3000%2F
Filter chain halted as CASClient::Frameworks::Rails::Filter rendered or redirected
Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
Oink Action: dashboard#index
Memory usage: 779472 | PID: 29159
Instantiation Breakdown: Total: 1 | ActiveRecord::SessionStore::Session: 1
Oink Log Entry Complete
首先,这不是@matthewford指出的错误。
第二,由于CAS服务器的内置和默认功能,这种重定向正在发生,您可以将其视为预先配置的Web服务器,就像脚手架一样。
第三,为了纠正此重定向,您需要在routes.rb
文件中检查与Web服务器CONTAing Routing Filters和有关的路由文件。
第四,如果这也不起作用,则此问题可能是由于SSL Certificate
配置所致。SSL证书配置通常负责Web服务器的这种root
重定向。