0

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 [email protected]
  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,

1 Answer 1

0

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

2
  • 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, 2011 at 16:55
  • SOme kind of name for the server. web.mysite.com e.g. Apr 30, 2011 at 9:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .