How to point one virtual host to another instance of apache running at another port on the same box

apache-2.2configurationredmine

I've got two apache2 instances running on my box. One came with a bitnami redmine stack which sole purpose is to host Redmine at host:8080/redmine. The other apache instance is running with php and such and is where I specify all the VHosts for my domains.

Now I'd like to point redmine.somedomain.com at www.somedomain.com:8080/redmine so that redmine is accessible through a subdomain and on port 80. Redmine is a Ruby on Rails app and runs with Phusion Passenger so I can't just point the vhost to the htdocs directory of the redmine install.

How is this done? I've tinkered with ProxyPass and ProxyPassReverse but I just can't get it working.

All help is greatly appreciated.

Best Answer

This will work for basic applications. I'm not familiar with redmine, so I'm not sure this will work.

ProxyRequests Off

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

<VirtualHost redmine.example.com:80>
    ProxyPass / http://localhost:8080/redmine
    ProxyPassReverse / http://localhost:8080/redmine
</VirtualHost>

There's more information on Running a Reverse Proxy if your application doesn't like this configuration. It happens sometimes when web applications get picky about the HTTP headers, or similar aspects of incoming requests.