Problems with /redmine URL

Added by salva salva over 4 years ago

Hi,

I'm installing the new Redmine but a having some troubles.

All is good until I try to enter. The Webpage shows me that it can't find some .js, .css,... and also if I click one link (for example projects) it goes to myurl.com/projects instead of myurl.com/redmine/projects.

I assume that it's a problem of url because it needs /redmine first so I write in config/environment.rb Redmine::Utils::relative_url_root = "/redmine" and the javascript,css problems has gone but the other problem persists

I tried to fix the last problem putting #RedmineApp::Application.routes.default_scope = { :path => '/redmine', :shallow_path => '/redmine' } but it doesn't work

Anybody can help me?

Thanks in advance
Regards

Replies (7)

RE: Problems with /redmine URL - Added by Jan Niggemann (redmine.org team member) over 4 years ago

Quoting what I already wrote in the ticket: No need to hack redmine, the problem lies in your webservers' (or appliaction servers') configuration.

RE: Problems with /redmine URL - Added by Jeffrey Lee over 4 years ago

When I upgrade Redmine from v1.2 to v2.3.1(or v2.3.2), I got the same problem.
There is the same problem on Redmine 2.3.1 and 2.3.2.
The source of main page (http://myURI/redmine/) is

 <script src="/redmine/javascripts/application.js?1372851859" type="text/javascript"></script>
 ...
 <link href="/redmine/plugin_assets/redmine_projects_accordion/stylesheets/redmine_projects_accordion.css?1374481923" ...
 ...
 <ul><li><a href="/my/account" class="my-account">My account</a></li>

The prefix "/redmine" is added for all files in "/var/www/redmine/public" (ex:/var/www/redmine/public/javascripts/*, /var/www/redmine/public/plugin_assets/*, /var/www/redmine/public/stylesheets/*, ...).
But it is not added for the links (ex: /my/page, /projects, /admin, ...).

However, it works on Redmine 1.2.
The source of main page (http://myURI/redmine/) is

 <script src="/redmine/javascripts/application.js?1307978778" type="text/javascript"></script>
 ...
 <script src="/redmine/plugin_assets/projects_tree_view/javascripts/projects_tree_view.js" ...
 ...
 <ul><li><a href="/redmine/my/account" class="my-account">My account</a></li>

My system environment is :

Apache/2.2.3
passenger-3.0.7
ruby 1.8.7
rails-2.3.11 and railties-3.2.13

"/etc/httpd/conf.d/redmine.conf" is attached.

redmine.conf (596 Bytes)

RE: Problems with /redmine URL - Added by Jeffrey Lee over 4 years ago

Hi,

The problem mentioned above is only adding Redmine::Utils::relative_url_root = "/redmine" in environment.rb.

After adding #RedmineApp::Application.routes.default_scope = { :path => '/redmine', :shallow_path => '/redmine' } in environment.rb, I got "Redmine 404 error".

I using "rake routes RAILS_ENV=production" to check the routes, all routes is adding prefix "/redmine" even the Home.

home    /redmine(.:format)    welcome#index

Check the Apache log (as attachment), Apache is finding "/" not "/redmine".

It maybe the settings problem of web server (Apache + passenger).

Does anyone have the idea for this problem?

RE: Problems with /redmine URL - Added by Jeffrey Lee over 4 years ago

Hi,

I solve the problem on Redmine 2.3.1 and 2.3.2.

Because I use Apache+Passenger, so ONLY the solution for "Using Passenger (aka mod_rails) features" needs to be applied.
  • Add symbolic link for /var/www/html/redmine to /var/www/redmine/public
    ln -s /var/www/redmine/public /var/www/html/redmine
    
  • Modify /etc/httpd/conf.d/redmine.conf as attachment

It is NOT necessary to modify environment.rb.

Besides, I failed to use ProxyPass/ProxyPassReverse for proxy redirect.
So I use 80 port instead of 8000 port for redmine virtual host.

redmine.conf (458 Bytes)

RE: Problems with /redmine URL - Added by Jan Niggemann (redmine.org team member) over 4 years ago

For the record: All of this is not needed when Apache is correctly configured.

RE: Problems with /redmine URL - Added by Mark Anderson over 3 years ago

Jan - can you clarify your response please? What/where is the proper configuration documented? You mention a ticket - which ticket?

thanks!

RE: Problems with /redmine URL - Added by Marco Gutsche over 3 years ago

OP has only created two issues, so it is either #14477 or #10572?

(1-7/7)