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've set up tens of sites before, I've been following the same process as always, but for some reason whenever i visit, the apache server loads /var/www (the default virtual host) instead of the virtual host.

going to (without the www) works and goes to the right place (/home/mysite/public_html).

This is on /etc/apache2/sites-available/:

# Place any notes or comments you have here
# It will make any customisation easier to understand in the weeks to come

# domain:
# public: /home/demo/public_html/

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /home/mysite/public_html

  # Custom log file locations

  LogLevel warn
  ErrorLog  /home/mysite/public_html/logs/error.log
  CustomLog /home/mysite/public_html/logs/access.log combined


These are the DNS records (last block removed):

MX  10
mail    A
www A

I'm running Ubuntu 10.04, i've reloaded and restarted the apache server multiple times.

Please let me know if you have any idea.


share|improve this question
up vote 0 down vote accepted

In your apache.conf before the include directives try setting a ServerName - even though it's the default.

share|improve this answer
What should I set it to? is not the only virtual host i'm planning to have on this machine.. – jamm1ng Apr 26 '11 at 16:55
SOme kind of name for the server. e.g. – Frands Hansen Apr 30 '11 at 9:02

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.