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

I've set up tens of sites before, I've been following the same process as always, but for some reason whenever i visit www.mysite.com, the apache server loads /var/www (the default virtual host) instead of the mysite.com virtual host.

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

This is mysite.com 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: domain1.com
# public: /home/demo/public_html/domain1.com/

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin info@mysite.com
  ServerName  mysite.com
  ServerAlias www.mysite.com


  # 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

  </VirtualHost>

These are the DNS records (last block removed):

    A       204.62.14.xxx
MX  10  mail.mysite.com.
NS      ns1.6sync.net.
NS      ns2.6sync.net.
NS      ns3.6sync.net.
mail    A       204.62.14.xxx
www A       204.62.14.xxx

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.

Thanks,

share|improve this question
add comment

1 Answer

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? mysite.com 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. web.mysite.com e.g. –  Frands Hansen Apr 30 '11 at 9:02
add comment

Your Answer

 
discard

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.