Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my office, I've set up two servers on one Windows 7 machine (and our network is a Windows domain). One is Apache, running on port 80, and another is the built in trac server running on port 8080. I've got a DNS entry that redirects reviewboard.etc.etc to the apache server, but for the trac server it still expects the port to be specified. How can I make it so that trac.etc.etc redirects to machinename:8080?


The solution, in case someone stumbles upon this later. The following went inside the <virtualhost *:80> block in a file included from my httpd.conf:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^trac\.etc\.etc
RewriteRule (.*) http://localhost:8080$1 [P]
ProxyPassReverse / http://localhost:8080/

Edited again to include ProxyPassReverse, without which all URLs generated by the proxied server will break

share|improve this question
up vote 1 down vote accepted

I don't know what "trac" is but if its default port is 8080 then set a A record for your public IP and do a NAT and Firewall through. In the more likely case its a web app/server then you still set the A record but DNS is not port aware, users will have to enter the 8080 unless you setup a redirect through Apache using something like mod redirect. - Sam's idea

share|improve this answer
As he already has Apache handling incoming requests on port 80, I would suggest that he setup forwarding from Apache to TRAC, using mode rewrite or similar. – Sam Feb 23 '11 at 12:46
True I thought about including that ;edit time. – Jacob Feb 23 '11 at 12:49

You can always use mod_proxy to handle the redirection to another server/port seamlessly as a passthrough. The basic documentation for mod_proxy available on covers how to do this.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.