[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Vhosts resolve to first vhost

Posted on 2010-09-01
Medium Priority
Last Modified: 2012-05-10
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
Question by:bretterer
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

Orcen earned 2000 total points
ID: 33583474
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.

Author Closing Comment

ID: 33583512

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A customer recently asked me about anti-malware and the different deployment options available for his business. Daily news about cyberattacks, zero-day vulnerabilities, and companies that suffered a security breach made him wonder if the endpoint …
Do you know what to look for when considering cloud computing? Should you hire someone or try to do it yourself? I'll be covering these questions and looking at the best options for you and your business.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question