Defect #20776
closedRedmine in a sub-URI does not work
0%
Description
I'm trying to run Redmine 3.1-stable on an Apache httpd together with some other apps to support the development. To make tools comfortably accessible I want all of them to run on the same port 80. VirtualHost running passenger runs on port 3000 without any problems, and I can work with Redmine there. I have httpd proxy defined for /redmine
and that works fine but even after defining Redmine::Utils::relative_url_root = "/redmine"
Redmine does not work correctly. Resources load fine (css, js) but links inside application are not prefixed.
I tried several approaches and (desperately) their combinations from HowTo Install Redmine in a sub-URI but nothing works. There are other resources referenced from the page which I tried as well without any success. I have also searched for issues on redmine.org and tried few things/patches from there and still no luck.
There are many discussions around this but all seem to be several years old so either I'm missing something or this is bug reintroduced?
Updated by Anton Wiedermann over 9 years ago
now after some more searching I found
which (is recent so I'm not the only one!! :) ) seems to suggest one possible solution, not sure if appropriate though (I'm no ruby/rails expert and I'd prefer if this worked out of the box)Updated by Toshi MARUYAMA over 9 years ago
- Status changed from New to Closed
- Resolution set to Invalid
Please use forum for questions.
It depends on web servers (passenger, thin, puma, etc.).
Updated by Anton Wiedermann over 9 years ago
figured it out after all... easy! :)
Perhaps this will help someone save few hours of work.. (I will not explain the values but it's not that difficult to understand once it's all written down in one place)
- append
Redmine::Utils::relative_url_root = '/redmine'
to redmine/conf/environment.rb - create passenger virtual host on port 3000 for redmine with sub-uri /redmine ...
> vim /etc/httpd/conf.d/redmine.conf
Listen 3000 <VirtualHost *:3000> ServerName 127.0.0.1 # document root for this server DocumentRoot /var/www/redmine/public # passenger config PassengerRuby /usr/local/bin/ruby PassengerAppRoot /var/www/redmine PassengerBaseURI /redmine PassengerDefaultUser redmine # rails config RailsBaseURI /redmine RailsEnv production # Relax Apache security settings <Directory /var/www/redmine/public> Allow from all Options -MultiViews # Uncomment this if you're on Apache >= 2.4: # Require all granted </Directory> </VirtualHost>
- create proxy from port 80 and /redmine to the redmine virtual host ...
> vim /etc/httpd/conf/httpd.conf
<VirtualHost *:80> ServerName server ServerAlias www.server ProxyPass /redmine http://localhost:3000/redmine ProxyPassReverse /redmine http://localhost:3000/redmine </VirtualHost>