HowTo Install Redmine on subdirectory (sub-URI) on Apache

Your Issue

You are probably running ruby 1.9, rails 3, apache, passenger and you want to run redmine.
Unfortunately, it's not rails-3 ready, and passenger can only run one ruby version.
So you've got two choices.
  1. relying on host header (
  2. sub-URI deployment (

This tutorial will focus on choice 2. Sub-URI deployment.


I'll assume you got redmine running stand-alone with mongrel or better even, with Thin


  1. Change the base-uri of your stand-alone application.
  2. Proxy it through apache.

Change the base-uri of your stand-alone application.

Quite simple actually.
Open up config/environment.rb and add at the very end of the file the following line:

Redmine::Utils::relative_url_root = "/redmine" 

Of course, you can choose whatever subdirectory you want it to run.

If you try to test your app on localhost:3000/redmine, all your css an js will show up broken.
In my setup, the routes to the js and css were actually rewriten to point to /redmine/javascript and /redmine/stylesheets, but the problem is that... the files aren't there!. As they are served staticly over public/*, rails rewrite actually breaks them, but, that is exactly what we want.
Don't worry. It'll be fixed on the next step.

Proxy it through apache.

Reverse proxy usually has two parts:
  1. redirecting a web request to other URI
  2. rewriting the returned HTML and header to match the sub-URI

On step N°1, a request to is sent to
On step N°2, the HTML is rewritten to change any reference of back to

But as all url references are relative, we never see the http part on an rails html, just the "/wharever", and we already reference the sub-URI with the relative_url_root line we added to environment.rb, so we can actually skip step N°2.

We just need to get redirected.
Assuming you are deploying to /redmine:
  1. add and enable a new site called redmine on apache
  2. edit the file and fill it up with this
    <Proxy *>
      Order deny,allow
      Allow from all
    ProxyRequests Off
    ProxyPass /redmine/
  3. fire up your Thin or mongrel server. thin start -e production -a -p3000
  4. restart apache sudo apache2ctl graceful


Just go open and you will be browsing your proxied redmine site.
IMPORTANT: remember the trailing slash! WORKS Won't work.

As a workaround, just create a file called redmine.html on the the www root with a simple redirect.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <title>Your Page Title</title>
    <meta http-equiv="REFRESH" content="3;url=/redmine/"></HEAD>
   Redirecting in 3 seconds...

Just change the 3 of the content value to 0 if you want an instant redirect.

That's all folks. I hope it helped someone.

Updated by Carlos Troncoso about 12 years ago · 2 revisions