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,