-   Linux - Server (
-   -   apache2 virtual hosting not resolving correctly (

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

apache2 virtual hosting not resolving correctly

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 it works fine. If I type (with out the www) it goes to a generic "under construction" page (try 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 (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.


chaosless 09-02-2009 11:37 AM

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

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

hope that helps.

$ ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=112 time=102.134 ms

$ ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=48 time=101.920 ms

spooge 09-02-2009 11:08 PM

i use two <virtualHost> entries




works for me.

~Chimera~ 09-03-2009 01: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 or

Thanks for the help

chrism01 09-04-2009 12:20 AM

You need an MX record

chaosless 09-04-2009 02:35 PM

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

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

All times are GMT -5. The time now is 12:21 PM.