プロジェクト

全般

プロフィール

Vote #72024

未完了

relative_url_root changes only css... , but not dynamic pages

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Rails support_44
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
44
version_id:
0
issue_org_id:
11147
author_id:
57667
assigned_to_id:
0
comments:
4
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
50
ステータス-->[New]

説明

I try to follow the instructions at http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI and have a local redmine installation serving at port 3000 with a URL prefix @/redmine2@. Later on I want to proxy this server via apache to @/redmine2@ on port 80.

Setting the relative_url_root to @/redmine2@ results in a "Redmine 404 error" page for the URL: @http://localhost:3000/redmine2/@ (Browser Cache is disabled).

Calling @http://localhost:3000/@ results in a "correct" page without layout... looking at the source:
All of the java script, atom and css links seem to be prefixed correctly with @/redmine2@, but not found there.

Sadly the redmine pages related links (like @/projects@, @/my/page@ or @/admin@) are not prefixed.

I don't know how to make use of this behaviour. So I feel a bit "lost" (as promised in the opening paragraph of the HowTo).

This is the config/environment.rb file

# Load the rails application
require File.expand_path('../application', __FILE__)

# Make sure there's no plugin in vendor/plugin before starting
vendor_plugins_dir = File.join(Rails.root, "vendor", "plugins")
if Dir.glob(File.join(vendor_plugins_dir, "*")).any?
  $stderr.puts "Plugins in vendor/plugins (#{vendor_plugins_dir}) are no longer allowed. " +
    "Please, put your Redmine plugins in the `plugins` directory at the root of your " +
    "Redmine directory (#{File.join(Rails.root, "plugins")})"
  exit 1
end

# Initialize the rails application
RedmineApp::Application.initialize!
Redmine::Utils::relative_url_root = "/redmine2"

restarting with mongrel:

#> ruby redmine-2.0/script/rails server mongrel -d -e production -p 3000
=> Booting Mongrel
=> Rails 3.2.5 application starting in production on http://0.0.0.0:3000

Some version infos (as provided on the Admin->Information page)

Environment:
  Redmine version                          2.0.2.stable.9774
  Ruby version                             1.8.7 (x86_64-linux)
  Rails version                            3.2.5
  Environment                              production
  Database adapter                         MySQL
Redmine plugins:
  no plugin installed

journals

Is anyone looking at this issue?
I've just updated to the latest redmine (via git) and I'm seeing the exact same problem. This is definitely a regression, as it was working fine for me before (rails 2 I guess). I've attached the html that gets generated and shows correct links for CSS/Javascript and incorrect links for basically everything else (some things even reference localhost!)

I've tried several of those "fixes" that are floating around (not sure why there are some many different ways of controlling this seemingly simple parameter) and none of them work.

FYI: I'm running redmine like this (as per instructions at http://www.redmine.org/projects/redmine/wiki/RedmineInstall):
@ruby script/rails server webrick -e production@
and that has always worked for me.

I'm also using this entry in additional_environment.rb: @config.action_controller.relative_url_root = "/redmine"@

After updating the routes.rb with @scope "/redmine" do@ and fixing up my apache forwarding file, it's at least emitting all the right URLs, except it's no longer able to find the CSS files under the /redmine path prefix.

Looks like this is RAILS3 bug after doing some more research.

--------------------------------------------------------------------------------
This has been discussed in #11881.

You have to both add @Redmine::Utils::relative_url_root = "/redmine"@ in @environment.rb@ *and* the scope in @routes.rb@ (or @RedmineApp::Application.routes.default_scope = '/redmine'@ before the call to @RedmineApp::Application.initialize!@ in @environment.rb@).
--------------------------------------------------------------------------------
Doesn't work.

Now I'm getting: @ActionController::RoutingError (No route matches [GET] "/redmine/javascripts/application.js")@.

It also generates RSS feeds like this (note the hostname!):
@<link href="http://localhost:3000/redmine/activity.atom" rel="alternate" title="Redmine: Activity" type="application/atom+xml" />@

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,New,11058,Run Redmine in a sub directory results in "No route matches"
relates,Closed,17309,RSS feed gives away localhost link

Admin Redmine さんが約2年前に更新

  • カテゴリRails support_44 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0