Vhosts resolve to first vhost

I have a rackspace server where i have two domains set up using vhosts in apache.  In my httpd.conf file i include a fine in conf.d/includes.conf

the contents of that file are
ServerName VNFrontEnd
ServerAdmin xxxxxx@xxxxxxxx.com

DocumentRoot /var/www/vhosts/default/httpdocs

<Directory "/var/www/vhosts">
    AllowOverride All
    Options SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
    <IfModule sapi_apache2.c>
    php_admin_flag engine off
    <IfModule mod_php5.c>
    php_admin_flag engine off

Include /var/www/vhosts/domain1.com/conf/httpd.include

Include /var/www/vhosts/domain2.be/conf/httpd.include

Open in new window

Both the files exist where they should and they include the following
domain1.com vhost
        ServerName      domain1.com:80
        ServerAlias     www.domain1.com:80

        DocumentRoot    /var/www/vhosts/domain1.com/httpdocs/www

Open in new window

domain1.com vhost
        ServerName      domain2.com:80
        ServerAlias     www.domain2.com:80

        DocumentRoot    /var/www/vhosts/domain2.com/httpdocs/www

Open in new window

My problem is that if i go to the ip address it resolves to domain1.com [which is ok]
if i go to domain1.com it resolves there as well
if i go to domain2.com it resolves to domain1.com    NOT GOOD!

Help is greatly appriciated.  We would like to launch this server tonight
Who is Participating?
OrcenConnect With a Mentor Commented:
You need to remove the www.domain1.com:80 and www.domain2.com:80, just use www.domain1.com and www.domain2.com for the Server Alias.

That way when you put the desired domain at the browser will work fine.
brettererAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.