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'm trying to accomplish something like this

DocumentRoot /www/

<VirtualHost *:80>

<VirtualHost *:80>
      DocumentRoot /www/

Is it possible to have ONE documentRoot for different domains?

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server localhost (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost localhost (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost aa.atd (/etc/apache2/sites-enabled/all-phoenix-domains:2)
         port 80 namevhost atd.atd (/etc/apache2/sites-enabled/all-phoenix-domains:13)
         port 80 namevhost test (/etc/apache2/sites-enabled/test:1)
Syntax OK
share|improve this question

No problem with that. But I'd rather used multiple serverAlias.

share|improve this answer
+1 Multiple ServerAlias lines definitely the preferred method here, or you need to specify the DocumentRoot in each VirtualHost. – James Yale Jun 7 '12 at 10:39

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.