Linux

Gitorious - 登錄時的 ActionController::UnknownHttpMethod?

  • February 22, 2013

我將安裝Gitorious作為從屬伺服器以進行故障轉移,請遵循部落格文章。

gitorious.conf

NameVirtualHost *:81

<VirtualHost *:81>
   ServerName  gitorious.domain.com
   ServerAdmin quanta@domain.com
   DocumentRoot /home/git/gitorious/public
   ErrorLog  /var/log/httpd/gitorious_error.log
   CustomLog /var/log/httpd/gitorious_access.log combined
   <Directory /home/git/gitorious/public>
       AllowOverride all
       Options -MultiViews
       Satisfy Any
   </Directory>
</VirtualHost>

NameVirtualHost *:443

<VirtualHost *:443>
   SSLEngine on
   SSLCertificateFile /etc/pki/tls/certs/ca-git.crt
   SSLCertificateKeyFile /etc/pki/tls/private/ca-git.key
   SSLProtocol all -SSLv2
   SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
   ServerName  gitorious.domain.com
   ServerAdmin quanta@domain.com
   DocumentRoot /home/git/gitorious/public
   ErrorLog  /var/log/httpd/gitorious_error.log
   CustomLog /var/log/httpd/gitorious_access.log combined
   <Directory /home/git/gitorious/public>
       AllowOverride all
       Options -MultiViews
       Satisfy Any
   </Directory>
</VirtualHost>

在我嘗試登錄之前一切正常,Firefox 給我以下錯誤:

SSL received a record that exceeded the maximum permissible length.

(Error code: ssl_error_rx_record_too_long)

production.log

ActionController::UnknownHttpMethod (V^C^A, accepted HTTP methods are get, head, put, post, delete, and options):
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/request.rb:35:in `request_method_without_openid'
 vendor/plugins/open_id_authentication/lib/open_id_authentication/request.rb:11:in `request_method'
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/request.rb:43:in `method'
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/routing/route_set.rb:499:in `extract_request_environment_without_host'
 vendor/plugins/routing-filter/lib/routing_filter.rb:74:in `extract_request_environment'
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/routing/route_set.rb:442:in `recognize'
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/routing/route_set.rb:437:in `call'
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/dispatcher.rb:87:in `dispatch'
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/dispatcher.rb:121:in `_call'
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
 vendor/bundle/ruby/1.8/gems/activerecord-2.3.17/lib/active_record/query_cache.rb:29:in `call'
 vendor/bundle/ruby/1.8/gems/activerecord-2.3.17/lib/active_record/query_cache.rb:29:in `call'
 vendor/bundle/ruby/1.8/gems/activerecord-2.3.17/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
 vendor/bundle/ruby/1.8/gems/activerecord-2.3.17/lib/active_record/query_cache.rb:9:in `cache'
 vendor/bundle/ruby/1.8/gems/activerecord-2.3.17/lib/active_record/query_cache.rb:28:in `call'
 vendor/bundle/ruby/1.8/gems/activerecord-2.3.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/string_coercion.rb:25:in `call'
 vendor/bundle/ruby/1.8/gems/rack-1.1.6/lib/rack/head.rb:9:in `call'
 vendor/bundle/ruby/1.8/gems/rack-1.1.6/lib/rack/methodoverride.rb:24:in `call'
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/params_parser.rb:15:in `call'
 vendor/bundle/ruby/1.8/gems/rails-2.3.17/lib/rails/rack/metal.rb:47:in `call'
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/session/cookie_store.rb:99:in `call'
 vendor/bundle/ruby/1.8/gems/activesupport-2.3.17/lib/active_support/cache/strategy/local_cache.rb:25:in `call'
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/failsafe.rb:26:in `call'
 vendor/bundle/ruby/1.8/gems/rack-1.1.6/lib/rack/lock.rb:11:in `call'
 vendor/bundle/ruby/1.8/gems/rack-1.1.6/lib/rack/lock.rb:11:in `synchronize'
 vendor/bundle/ruby/1.8/gems/rack-1.1.6/lib/rack/lock.rb:11:in `call'
 vendor/bundle/ruby/1.8/gems/actionpack-2.3.17/lib/action_controller/dispatcher.rb:106:in `call'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/utils.rb:470:in `safe_fork'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:180:in `start'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
 /opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.19/helper-scripts/passenger-spawn-server:99

gitorious_access.log

[22/Feb/2013:15:42:01 +0700] "GET /login HTTP/1.1" 302 103 "http://gitorious.domain.com:81/" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:18.0) Gecko/20100101 Firefox/18.0"
- - [22/Feb/2013:15:42:01 +0700] "\x16\x03\x01" 500 1921 "-" "-"

是什麼\x16\x03\x01意思?

是什麼\x16\x03\x01意思?

這是一個奇怪的 URI。

如果你注意地址欄,你會看到 URL 是:

https://gitorious.domain.com:81/login

這意味著您正在嘗試將 HTTPS 與 HTTP 伺服器通信。https://gitorious.domain.com/login解決方法是簡單地從該 URL ( )中刪除埠號。

引用自:https://serverfault.com/questions/481415