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

I edit /etc/hosts file to add domains. I add new virtual host for new domain. So I can easily develop.

What I want now is to have apache conf to

  1. if there is a virtualhost domain definition follow
  2. if not, look for /var/www directory, if there is dir follow
  3. if there is not, redirect to /var/www/nerkn

Can apache conf make it?

1)Example domain

  1. there is no in virtualhost
  2. there is a directory named /var/www/ so server there

2)Exampple domain

  1. there is no in virtualhost
  2. there is no directory named /var/www/
  3. serve from /var/www/nerkn
share|improve this question

1 Answer 1

up vote 0 down vote accepted

Mod_vhost_alias, where nerkn defined as default virthost

VirtualDocumentRoot d:/Sites/%0/web
VirtualScriptAlias d:/Sites/%0/cgi-bin

define base location of bare minimum (my config)

while adding <VirtualHost> allow redegine-add vhost-specific details

share|improve this answer
it only solves 2nd bu its ok. Thank you – nerkn Oct 18 '11 at 13:33
it work most times for me in 1st mode - I just copy skeleton to the new site-location and have site ready without restart of apache – Lazy Badger Oct 18 '11 at 13:46
wonderful ln -s nerkn new-site – nerkn Oct 21 '11 at 7:55

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.