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

I have read the documentation on how to create a dynamic virtual host system on Apache's website, but I am quite confused about some things:

1) Do I have to dynamically configure window's host file to update each time a virtual host is added, if so, how?

2) Say a domain gets a name change, do I have to just rename the directory and edit the host file aswell?

3) For a vitualhost to direct it's name to a subdomain all I need to do is

VirtualDocumentRoot /www/hosts/%0/docs 

where 0% =, right? Without the hassle of learning how to configure a DNS.

4) Also, how would I stop others from accessing other people's directories?

share|improve this question
up vote 0 down vote accepted

It'd make answering this easier if you told us what you're trying to accomplish. But you seem lost on a few things so I'll try. 1. If DNS is configured properly, no. You'd need wild card DNS entries * 2. no, but you'd need to update your apache config, add the server alias. 3. Not sure, I'd have to re-read the docs again. 4. simple, htaccess per directory. can tie this to AD as well.

share|improve this answer
Thanks, I am basically trying to create a shared hosting environment. – user81536 May 20 '11 at 5:59

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.