LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-21-2009, 10:27 AM   #1
Rauldinho
LQ Newbie
 
Registered: Nov 2004
Posts: 20

Rep: Reputation: 0
Problem with DNS and VirtualHost


Hi, i'm having a problem with the configuration of two virtual host in an apache web server. The IP of my web server is 192.168.1.20 and the 2 domains are support.domain.com and documentation.domain.com. In my local DNS the configuration for these domains are as follow. The 2 domains point to the web server correctly, but the problem is that in the virtual host configuration in apache the 2 domains are using only one of them, i mean, both domain point to the same virtual host. I think the problem is because one of the domains is configured with a CNAME record that uses the other domain name and apache sees it like the same, i just want to be sure since i'm not the one that administrates the DNS. Thanks for any answer i may get.


Quote:
user@server:~$ host -a support.cvgin.com Trying "support.domain.com" ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60862 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2 ;; QUESTION SECTION: ;support.domain.com. IN ANY ;; ANSWER SECTION: support.domain.com. 38400 IN CNAME documentation.domain.com.

Quote:
user@server:~$ host -a documentation.domain.com Trying "documentation.domain.com" ;; QUESTION SECTION: ;documentation.domain.com. IN ANY ;; ANSWER SECTION: documentation.domain.com. 38400 IN A 192.168.1.20 Received 147 bytes from 160.100.1.208#53 in 2 ms

Last edited by Rauldinho; 01-21-2009 at 10:33 AM.
 
Old 01-21-2009, 11:29 AM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Quote:
I think the problem is because one of the domains is configured with a CNAME record that uses the other domain name and apache sees it like the same,
No, that's not the problem. It doesn't matter how the name is resolved to an IP address, whether by A record or via CNAME. The client still tells the web server the original name using a "Host: " header. That's the point of virtual hosts: that different sites can be hosted on a single IP address.
 
Old 01-21-2009, 11:40 AM   #3
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
You should have the domain names resolve from your registrar to your server IP. Once the connection reaches your server IP address the the VirtualName will resolve the the correct virtual host name. Use the Address rather than CName.

Code:
www.hostname.com     Address      xxx.xxx.xxx.xxx
sub.hostname.com     Address      xxx.xxx.xxx.xxx
Then set up your virtual hosts in either your /etc/http.conf file or /etc/apache2/sites-available to resolve the URL to the correct DocumentRoot and other directives.

Last edited by AuroraCA; 01-21-2009 at 11:43 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
subdomain redirection problem with virtualhost jhwilliams Linux - Networking 2 05-21-2008 05:21 PM
Apache Virtualhost problem phantom_cyph Linux - Server 6 04-20-2008 12:04 PM
Apache 2.2.3 on CentOS 5 - VirtualHost problem djjoshuad Linux - Server 2 04-19-2007 12:54 PM
Apache VirtualHost Redirect Problem... SiLiCoN Linux - Networking 5 05-03-2005 08:41 AM
VirtualHost Apache 2 Problem Chris_K1 Linux - Networking 0 01-25-2005 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration