Some errors in apache proxy
Closed this issue · 3 comments
damulhan commented
I want to use camaleon cms as apache web server proxy tunneling.
But some errors occurs. I cannot know how to do with it.
Direct accessing through port 3000 did not have errors.
actionpack (5.2.1) lib/abstract_controller/helpers.rb:162:in `rescue in block in modules_for_helpers'
actionpack (5.2.1) lib/abstract_controller/helpers.rb:155:in `block in modules_for_helpers'
actionpack (5.2.1) lib/abstract_controller/helpers.rb:144:in `map!'
actionpack (5.2.1) lib/abstract_controller/helpers.rb:144:in `modules_for_helpers'
actionpack (5.2.1) lib/action_controller/metal/helpers.rb:94:in `modules_for_helpers'
actionpack (5.2.1) lib/abstract_controller/helpers.rb:108:in `helper'
actionpack (5.2.1) lib/action_controller/railties/helpers.rb:19:in `inherited'
app/controllers/application_controller.rb:1:in `<main>'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
activesupport (5.2.1) lib/active_support/dependencies.rb:472:in `block in load_file'
activesupport (5.2.1) lib/active_support/dependencies.rb:657:in `new_constants_in'
activesupport (5.2.1) lib/active_support/dependencies.rb:471:in `load_file'
activesupport (5.2.1) lib/active_support/dependencies.rb:369:in `block in require_or_load'
activesupport (5.2.1) lib/active_support/dependencies.rb:37:in `block in load_interlock'
activesupport (5.2.1) lib/active_support/dependencies/interlock.rb:14:in `block in loading'
activesupport (5.2.1) lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
activesupport (5.2.1) lib/active_support/dependencies/interlock.rb:13:in `loading'
activesupport (5.2.1) lib/active_support/dependencies.rb:37:in `load_interlock'
activesupport (5.2.1) lib/active_support/dependencies.rb:352:in `require_or_load'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:46:in `block in require_or_load'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:45:in `require_or_load'
activesupport (5.2.1) lib/active_support/dependencies.rb:506:in `load_missing_constant'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `block in load_missing_constant'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:57:in `load_missing_constant'
activesupport (5.2.1) lib/active_support/dependencies.rb:193:in `const_missing'
camaleon_cms (2.4.5.8) app/controllers/camaleon_cms/camaleon_controller.rb:1:in `<main>'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
activesupport (5.2.1) lib/active_support/dependencies.rb:472:in `block in load_file'
activesupport (5.2.1) lib/active_support/dependencies.rb:657:in `new_constants_in'
activesupport (5.2.1) lib/active_support/dependencies.rb:471:in `load_file'
activesupport (5.2.1) lib/active_support/dependencies.rb:369:in `block in require_or_load'
activesupport (5.2.1) lib/active_support/dependencies.rb:37:in `block in load_interlock'
activesupport (5.2.1) lib/active_support/dependencies/interlock.rb:14:in `block in loading'
activesupport (5.2.1) lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
activesupport (5.2.1) lib/active_support/dependencies/interlock.rb:13:in `loading'
activesupport (5.2.1) lib/active_support/dependencies.rb:37:in `load_interlock'
activesupport (5.2.1) lib/active_support/dependencies.rb:352:in `require_or_load'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:46:in `block in require_or_load'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:45:in `require_or_load'
activesupport (5.2.1) lib/active_support/dependencies.rb:506:in `load_missing_constant'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `block in load_missing_constant'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/active_support.rb:57:in `load_missing_constant'
activesupport (5.2.1) lib/active_support/dependencies.rb:193:in `const_missing'
camaleon_cms (2.4.5.8) app/controllers/camaleon_cms/frontend_controller.rb:1:in `<main>'
bootsnap (1.3.2) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
...
The apache httpd.conf settings are like here:
<VirtualHost OO.OO.OO.OO>
ServerName OOOOO
<IfModule mod_proxy.c>
ProxyRequests On
<Proxy *>
Order deny,allow
Allow from all
#Require all granted
</Proxy>
<Location />
ProxyPass http://127.0.0.1:8000/ retry=0
ProxyPassReverse http://127.0.0.1:8000/
</Location>
</IfModule>
</VirtualHost>
owen2345 commented
Hi @damulhan
Looks like something is not configured well.
helpers/camaleon_cms/admin/application_helper.rb with module "CamaleonCms::Admin::ApplicationHelper" too.
Cheers!
damulhan commented
Upper error was shown after patching by adding next lines in app/application_controller.rb like this:
class ApplicationController < ActionController::Base
skip_before_filter :verify_authenticity_token
protect_from_forgery prepend: true, with: :exception
end
helpers/camaleon_cms/admin/application_helper.rb ... was never changed.
damulhan commented
I added this option in apache conf. And it worked.
ProxyPreserveHost on