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

My Apache virtual host configuration only works for but not Can you tell me why?

<VirtualHost *:80>
    DocumentRoot /var/www/stable/

    <Directory />
        Options FollowSymLinks Indexes +ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
        AddHandler fcgid-script .php
        FCGIWrapper /var/www/php-fcgi-scripts/stable/php-fcgi-starter .php

share|improve this question
up vote 0 down vote accepted

Maybe somewhere else in your Apache configuration there is another or ServerName/ServerAlias for ''?

share|improve this answer
I did a grep on "" but found nothing wierd in either /etc/ or /var/. – Christoffer Mar 1 '10 at 15:24
Ok, it wasn't really any other option but a standard site was defined which was overriding my options. Once I removed it all is well. – Christoffer Mar 1 '10 at 15:28

It should probably be:


Make sure to restart apache as well...

share|improve this answer

Have you got host entries setup for but not ? As it sounds like its not resolving as your apache configuration looks good. Can you ping each address and ensure its going to the correct location?

share|improve this answer
When I visit I get to the standard Apache index file in /var/www/index.html... But points to /var/www/stable/index.php – Christoffer Mar 1 '10 at 15:07

replace ServerAlias with ServerAlias do and have the same ip address/ips that are configured for this host?

share|improve this answer

Hmmm, are you sure your DNS answers the same for and To make sure it is the case, a simple check might help:


I've been sometimes struggling for nothing since the two A records would not return the same thing. If or once they are pointing on the same IP then Apache conf can be tuned but this is what I use and it works:


Don't forget to reload Apache (no need to restart it completely and disconnect clients):

/etc/init.d/apache2 reload

(or similar)

Good luck!

share|improve this answer
They return exactly the same on nslookup. – Christoffer Mar 1 '10 at 15:04

Have you specified NameVirtualHost *:80?


share|improve this answer

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.