1

How can I set the path on which Redmine should be run, e.g. example.com:3000/redmine instead of example.com:3000? There is an appropriately named option in the settings panel, but it serves a different purpose, according to the documentation and experimental observations (it is used to write URL in emails sent to users).

A wider picture: I need this in order to properly serve Redmine on port 80 over Apache's mod_proxy (i.e. at example.com/redmine). The problem is that when running it on /, the home page fails to load the necessary resources (such as JavaScript and CSS files). Any workarounds?

dpq
  • 416
  • 3
  • 17

2 Answers2

2

I made use of the Proxy-HTML module:

    ProxyPass /redmine http://example.com:3000
    ProxyHTMLURLMap http://example.com:3000 /redmine
    <Location /redmine>
        ProxyPassReverse http://example.com:3000
        SetOutputFilter proxy-html
        ProxyHTMLURLMap /               /redmine/
        ProxyHTMLURLMap /redmine/       /redmine
    </Location>
dpq
  • 416
  • 3
  • 17
1

The usage of output filters is actually a bad idea, as I can't work everywhere.

A better idea would be to instruct your app-server (mongrel, thin, whatever) to tell Rails the base URL where the app is deployed. That way, Rails can directly generate the correct links. This can be done by appending --prefix /redmine to the app-server parameters.

In the cluster.xml file used by mongrel_cluster, the same can be accomplished by inserting

prefix: /redmine

into it. (at least, I believe this syntax is correct)

Holger Just
  • 3,315
  • 1
  • 16
  • 23