Project

General

Profile

Actions

Defect #20776

closed

Redmine in a sub-URI does not work

Added by Anton Wiedermann about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

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.

version information

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?

Actions #1

Updated by Anton Wiedermann about 9 years ago

now after some more searching I found Problem running Redmine on a subfolder 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)

Actions #2

Updated by Toshi MARUYAMA about 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.).

Actions #3

Updated by Anton Wiedermann about 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)

  1. append Redmine::Utils::relative_url_root = '/redmine' to redmine/conf/environment.rb
  2. 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>
    
  3. 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>
    
Actions

Also available in: Atom PDF