Defect #11881
closedFCGI mode does not support sub-URI
Added by Jonathan Tee about 14 years ago. Updated almost 3 years ago.
Description
Hi,
i installed redmine in a subdir /redmine.
My Setup: Redhat5,apache with fcgid
Every links in Redmine are generated correct, e.g. /redmine/projects/bal and so on. But if i go to my projectssettings (/redmine/projects/myproject/settings) some links are not generated correctly.
Tab Members, if i try to change the role -> 404 (The requested URL /memberships/8 was not found on this server. (/redmine/ is missing)
Tab Repositries
edit/del/user-links for an existing repro are not working, same like above:
<a href="/repositories/7/committers" class="icon icon-user">User</a>
<a href="/repositories/7/edit" class="icon icon-edit">Edit</a>
<a href="/repositories/7" class="icon icon-del" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Delete</a>
my Config:
environment.rb:Redmine::Utils::relative_url_root = "/redmine"
environment.rb:ActionController::Base.relative_url_root = "/redmine"
routes.rb (had to add scope and end):
RedmineApp::Application.routes.draw do
scope "/redmine" do
....
end
Updated by Jonathan Tee about 14 years ago
Actions
#1
Environment:
Redmine version 2.1.0.stable
Ruby version 1.8.7 (x86_64-linux)
Rails version 3.2.8
Environment production
Database adapter MySQL
Updated by Jean-Philippe Lang about 14 years ago
Actions
#2
- Status changed from Resolved to New
Updated by Den Iskandarov about 14 years ago
Actions
#3
Updated by Jonathan Tee about 14 years ago
Actions
#4
a half duplicate #11274
Updated by Etienne Massip about 14 years ago
Actions
#5
What's your Apache/.htaccess Redmine specific configuration looks like?
If you don't have any URL rewriting directive, i.e. Rails is handling application routes and assets URLs generation alone, then you could try to:
- remove your changes in both
environment.rbandroutes.rb - add this single line in
environment.rbright before the call toRedmineApp::Application.initialize!:
Updated by Jonathan Tee about 14 years ago
Actions
#6
hi,
my .htaccess looks like
#diff htaccess.fcgi.example .htaccess
32a33
RewriteBase /redmine
i changed my config to your suggestion. Now css and js-links are also wrong: /css/.. and /js/... instead of /redmine/css.
everythings else is working, but not the repository-settings. Same error as above.
My apache conf for redmine:
#redmine
Alias /redmine /var/opt/apache/myvirthost/redmine/public/
Updated by Etienne Massip about 14 years ago
Actions
#7
Jonathan Tee wrote:
i changed my config to your suggestion. Now css and js-links are also wrong: /css/.. and /js/... instead of /redmine/css.
My bad, you should keep the Redmine::Utils::relative_url_root = '/redmine' in environment.rb after the call to initialize!.
everythings else is working, but not the repository-settings. Same error as above.
It works fine for me and links are correctly generated, could that be a plugin issue?
Updated by Jonathan Tee about 14 years ago
Actions
#8
Etienne Massip wrote:
My bad, you should keep the
Redmine::Utils::relative_url_root = '/redmine'inenvironment.rbafter the call toinitialize!.
ok, added again. Now css and js-url works fine.
It works fine for me and links are correctly generated, could that be a plugin issue?
i removed all plugins, but same error.
What i don't understand when i look into the view _repositories.html.erb is how the urls are generated:
committers_repository_path(repository)
edit_repository_path(repository)
repository_path(repository)
doesn't work, but
new_project_repository_path(@project)
works
are these functions? if yes where can i find the definition?
Updated by Etienne Massip about 14 years ago
Actions
#9
Jonathan Tee wrote:
are these functions? if yes where can i find the definition?
They are convenience methods automatically created by Rails from the routes definition.
As you set the scope for routes, I don't get why these specific ones wouldn't be treated like the others.
What gives you rake routes RAILS_ENV=production?
What about running (in production mode) with Webrick (you need to comment out the Redmine::Utils::relative_url_root = '/redmine' to test it)?
Updated by Abdul Halim Mat Ali about 14 years ago
Actions
#10
I have run Redmine in multiple sub-URI and have no issues with it.
Maybe somebody should update http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI
or any related wiki on sub-URI.
You don't need to set Redmine::Utils::relative_url_root = "/redmine".
Below are the steps if you using apache assuming /var/www is your root directory and you have untar your Redmine
to /opt/redmine.
BTW, I am using Apache with Passenger.
- Create the symbolic link
- in /etc/httpd/conf.d/redmine.conf
Updated by Etienne Massip about 14 years ago
Actions
#11
Abdul Halim Mat Ali wrote:
I have run Redmine in multiple sub-URI and have no issues with it.
Abdul, just to make sure, are you using Redmine 2.x?
Updated by Abdul Halim Mat Ali about 14 years ago
Actions
#12
Updated by Jonathan Tee about 14 years ago
Actions
#13
Etienne Massip wrote:
What gives you
rake routes RAILS_ENV=production?
interesting...
all entries have a /redmine-prefix except
membership GET /memberships/:id(.:format) members#show
PUT /memberships/:id(.:format) members#update
DELETE /memberships/:id(.:format) members#destroy
edit_issue_category GET /issue_categories/:id/edit(.:format) issue_categories#edit
issue_category GET /issue_categories/:id(.:format) issue_categories#show
PUT /issue_categories/:id(.:format) issue_categories#update
DELETE /issue_categories/:id(.:format) issue_categories#destroy
committers_repository GET|POST /repositories/:id/committers(.:format) repositories#committers
edit_repository GET /repositories/:id/edit(.:format) repositories#edit
repository PUT /repositories/:id(.:format) repositories#update
DELETE /repositories/:id(.:format) repositories#destroy
relation GET /relations/:id(.:format) issue_relations#show
DELETE /relations/:id(.:format) issue_relations#destroyif i look into routes.rb, all these entries have ":shallow => true"
Updated by Etienne Massip about 14 years ago
Actions
#14
Updated by Jonathan Tee about 14 years ago
Actions
#15
- % Done changed from 0 to 90
thanks, you did it. Now it works :-)
now my environment.rb looks like:
...
RedmineApp::Application.routes.default_scope = { :path => '/redmine', :shallow_path => '/redmine' }
# Initialize the rails application
RedmineApp::Application.initialize!
Redmine::Utils::relative_url_root = '/redmine'
I've checked all my configs again but i'm quite sure i did not change other settings. But i know that i didn't changed any core files. Just the files in the config dir.
Updated by Dmitry Vorobiev about 14 years ago
Actions
#16
Jonathan Tee wrote:
thanks, you did it. Now it works :-)
now my environment.rb looks like:
[...]I've checked all my configs again but i'm quite sure i did not change other settings. But i know that i didn't changed any core files. Just the files in the config dir.
Jonathan,
I have probably similar problem (#12102), unfortunately advice with RedmineApp::Application.routes.default_scope don't help fix it.
Updated by Etienne Massip about 14 years ago
Actions
#17
- Subject changed from Installed Redmine in a sub-URI: Links are generated not correctly in Settings ->Error 404 to FCGI mode does not support sub-URI
- Status changed from New to Confirmed
source:/tags/2.1.2/public/dispatch.fcgi.example should set env['SCRIPT_NAME'] to the value of Redmine::Utils::relative_url_root.
Updated by Etienne Massip about 14 years ago
Actions
#18
- Target version set to Candidate for next minor release
Updated by Etienne Massip about 14 years ago
Actions
#19
- Priority changed from High to Normal
Updated by Bill Levering almost 14 years ago
Actions
#20
Note: I tried posting this to: http://www.redmine.org/boards/2/topics/30676?r=30881
where it seems it would be most useful, but I always get 'posting denied as spam'
Working Redmine subdir/nginx:
- Redmine 2.2.0 (fresh install)
- no plugins
- ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
- rails (3.2.9)
- passenger (3.0.18)
- nginx version: nginx/1.2.4
as per:
[[http://www.redmine.org/issues/11881#note-14]]
config/environment.rb:
RedmineApp::Application.routes.default_scope = { :path => '/redmine', :shallow_path => '/redmine' }
RedmineApp::Application.initialize!
Redmine::Utils::relative_url_root = '/redmine'
nginx.conf: (mostly unchanged)
http {
passenger_root /usr/local/rvm/gems/ruby-1.9.3-p327/gems/passenger-3.0.18;
passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.3-p327/ruby;
server {
listen 80;
server_name localhost;
location /redmine {
root /usr/local/redmine/public;
passenger_enabled on;
}
}
}
THEN, create soft link in the public directory:
Updated by Den Iskandarov almost 14 years ago
Actions
#21
no chance to get this fixed in next major or minor release :( ?
Updated by Go MAEDA almost 3 years ago
Actions
#22
- Status changed from Confirmed to Closed
- Target version deleted (
Candidate for next minor release) - Resolution set to Wont fix
I am closing this issue because FastCGI support will be removed in the upcoming Redmine 6.0.0 (#40092).