LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   apache2 virtual hosting not resolving correctly (https://www.linuxquestions.org/questions/linux-server-73/apache2-virtual-hosting-not-resolving-correctly-752096/)

~Chimera~ 09-02-2009 09:15 AM

apache2 virtual hosting not resolving correctly
 
Hello,

I am running Ubuntu 8.04 as a server and this question specifically deals with apache2 (I think). I have 6 domains resolving to this server and I have virtual hosting set up and it works great. However, there are some small problems that I would like to fix and my attempts have been futile.

First, it I am attempting to reach site1 and type www.site1.com it works fine. If I type site1.com (with out the www) it goes to a generic "under construction" page (try nobledivers.com to see what I mean). This happens on all the sites. I tried making another entry in the sites-enable folder and calling the ServerName with out the www and the ServerAlias with the www (this is the opposite the other entry). Also, I pinged the site both ways and the ip address is correct so it isn't a DNS problem.

Second, if I type wow.nobledivers.com (which doesn't exist so should be redirected to the original site) it is redirected to a completely different site on the server. This one I am lost on, but again, this is a server problem and not a DNS problem (as far as I can tell).

Any help would be great. Thank you.

Chimera

chaosless 09-02-2009 10:37 AM

think i see why you get 'under construction' for nobledrivers.com but it works for www.nobledrivers.com looks like it IS a dns issue...

unless you have decided to do port 80 redirect with a router, your catchall address for nobledrivers.com goes to a different machine than www.nobledrivers.com - shown in the ping output below.

hope that helps.
/james

$ ping nobledivers.com
PING nobledivers.com (65.214.119.53): 56 data bytes
64 bytes from 65.214.119.53: icmp_seq=0 ttl=112 time=102.134 ms

$ ping www.nobledivers.com
PING www.nobledivers.com (65.214.119.51): 56 data bytes
64 bytes from 65.214.119.51: icmp_seq=0 ttl=48 time=101.920 ms

spooge 09-02-2009 10:08 PM

i use two <virtualHost> entries
using:
Quote:


ServerAlias mydomain.com

and

ServerAlias www.mydomain.com

works for me.

~Chimera~ 09-03-2009 12:13 PM

Thanks chaosless.

I went to the DNS and found that the @ symbol represents nothing in the prefix. So I changed that to resolve to the correct address. However, I think the email will be going to the wrong place (email and web hosting are done on different servers). So, does anyone know what the DNS needs as a prefix to forward the email to the correct IP? Something like mail.site.com or smtp.site.com?

Thanks for the help

chrism01 09-03-2009 11:20 PM

You need an MX record http://www.linuxtopia.org/online_boo...bind-zone.html

chaosless 09-04-2009 01:35 PM

MX record will tell email servers from elsewhere (when trying to complete a request to you@yourdomain.com) how to find your email server.

you may also need mail.yourdomain.com so to configure your own email client with the right address for getting/sending email.


All times are GMT -5. The time now is 10:36 PM.