Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I am developing a site on my local machine and want to point a subdomain of an existing site to my localhost's subdomain. A concrete example:

I have a normal running apache on port 80, and a virtual host on port 8081. I want to point to my virtual host.

I've tried adding it to the hosts file, but ports don't work there.

Am using Windows 7 x64

share|improve this question
up vote 1 down vote accepted

Remove the virtual host running on port 8081 and make it listen op port 80. Your vhosts should look somewhat like this:

DocumentRoot c:/htdocs/www/main

DocumentRoot c:/htdocs/www/dev
share|improve this answer
Ah, I see now, so both should listen to port 80, but they should be name-based hosts. Think I also have to uncomment the line NameVirtualHost *:80 in this case. Thanks! – Eduard Luca May 14 '12 at 12:01
Indeed. You can also use a * instead of the IP, that way your sites can be accessed from all your interfaces. – Bart De Vos May 14 '12 at 12:04

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.