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 setup a local working copy of my domain and I've modified the "domain" file within /etc/apache2/sites-available/, executed "sudo a2ensite domain" and then restarted apache and my browser is not looking locally for the domain. What step am I missing?

NameVirtualHost domain:80

<VirtualHost domain:80>
  ServerName domain
  DocumentRoot /var/www/

I should also point out that I am aware that the folder name has .com and the virtual host does not.

Update When I use *:80 instead of domain:80 I get the following error...

[Wed Mar 24 15:22:28 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
share|improve this question
up vote 2 down vote accepted

Your Apache config looks OK. It seems that your server resolves domain address as the remote one. Try to add a line to your local /etc/hosts to fix this. The line should look like:  domain

If your local Apache is listening on the other network interface, replace with the proper IP address

share|improve this answer
Bah! I knew I was missing something like this... you got it – Webnet Mar 25 '10 at 13:03

This FAQ will help shed some light, I think.

The NameVirtualHost directive should refer to an interface (, *,, etc).

Something along the lines of

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName domain
  DocumentRoot /var/www/

You then need to verify that domain does resolve to either the listed interface in the NameVirtualHost directive, or to the specific addresses used. If you're working from the web server you can add domain to the local hosts file for, or whatever address you used.

share|improve this answer
When I use that method.... I get this.... [Wed Mar 24 15:22:28 2010] [warn] NameVirtualHost *:80 has no VirtualHosts [Wed Mar 24 15:22:28 2010] [warn] NameVirtualHost *:80 has no VirtualHosts – Webnet Mar 24 '10 at 19:22

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.