Solved

Vhosts resolve to first vhost

Posted on 2010-09-01
2
414 Views
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
NameVirtualHost 184.106.230.48:80
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>
    <IfModule mod_php5.c>
    php_admin_flag engine off
    </IfModule>
</Directory>



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
<VirtualHost 184.106.230.48:80>
        ServerName      domain1.com:80
        ServerAlias     www.domain1.com:80

   
        DocumentRoot    /var/www/vhosts/domain1.com/httpdocs/www
</VirtualHost>

Open in new window


domain2.com
domain1.com vhost
<VirtualHost 184.106.230.48:80>
        ServerName      domain2.com:80
        ServerAlias     www.domain2.com:80

   
        DocumentRoot    /var/www/vhosts/domain2.com/httpdocs/www
</VirtualHost>

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
0
Comment
Question by:bretterer
2 Comments
 
LVL 2

Accepted Solution

by:
Orcen earned 500 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.
0
 
LVL 3

Author Closing Comment

by:bretterer
ID: 33583512
THANK YOU!!!
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Monitoring systems evolution, cloud technology benefits and cloud cost calculators business utility.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Both in life and business – not all partnerships are created equal. Spend 30 short minutes with us to learn:   • Key questions to ask when considering a partnership to accelerate your business into the cloud • Pitfalls and mistakes other partners…

862 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now