Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to accomplish something like this

DocumentRoot /www/_offline.com

<VirtualHost *:80>
      ServerName example1.com
      ServerAlias www.example1.com

<VirtualHost *:80>
      ServerName example2.com
      ServerAlias www.example2.com
      DocumentRoot /www/_offline.com

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

1 Answer 1

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.