Virtual Hosts not working for 2nd site

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Virtual Hosts not working for 2nd site

Postby Kurt R » 21. October 2011 17:21

I am testing the virtual host setup on my server 2008 R2 and the first site loads but the 2nd one doesn't.

Code: Select all
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
    ServerAdmin name@avernon.net
    DocumentRoot "/xampp/htdocs/avernon"
    ServerName www.avernon.net
    ServerAlias www.avernon.net *.avernon.net
    ErrorLog "logs/avernon.log"
    CustomLog "avernon.log" combined
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin name@lambdacomputers.com
    DocumentRoot "/xampp/htdocs/lambda"
    ServerName www.lambdacomputers.com
    #ServerAlias
    ErrorLog "logs/lambda.log"
    CustomLog "logs/lambda.log" combined
</VirtualHost>


I am getting the following error showing in the event viewer:

Code: Select all
The Apache service named  reported the following error:
>>> [Fri Oct 21 08:08:13 2011] [error] (OS 11001)No such host is known.  : Could not resolve host name www.lambdacomputers.com -- ignoring!


This is not on my production server just a DNS server.

Avernon.net is routed to my dynamic IP via DNS2Go and the lambdacomputers.com is routed using melboureit DNS "A" name record.

Please advise.

Kurt R
Kurt R
 
Posts: 4
Joined: 21. October 2011 17:04
Operating System: Server 2008 R2

Re: Virtual Hosts not working for 2nd site

Postby JonB » 21. October 2011 18:37

Well, it looks like Apache is reliable at least:

C:\Documents and Settings\jon>ping http://www.lambdacomputers.com
Ping request could not find host http://www.lambdacomputers.com. Please check the name
and try again.


http://www.intodns.com/lambdacomputers.com

WWW Error WWW A Record ERROR: I could not get any A records for http://www.lambdacomputers.com!


You don't appear to have any A records set up in your nameservers :shock:

Good Luck
8)


ysf
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Virtual Hosts not working for 2nd site

Postby Kurt R » 21. October 2011 19:28

OK, weird, I can ping lambdacomputers.com but not www.lambdacomputers.com.

Is that part of the problem?
Kurt R
 
Posts: 4
Joined: 21. October 2011 17:04
Operating System: Server 2008 R2

Re: Virtual Hosts not working for 2nd site

Postby JonB » 21. October 2011 21:31

Well, if you don't have an "A" address, any machine that doesn't have a 'hosts' file entry or access to a 'private' DNS server where that address is resolvable won't be able to 'resolve' the hostname (http://www.lambdacomputers.com). I'd say that is an issue. :shock:

Brien Posey is the Yoda of DNS:
http://searchnetworkingchannel.techtarg ... r-failures
http://searchnetworkingchannel.techtarg ... r-failures

Good Luck
8)

ytsf
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Virtual Hosts not working for 2nd site

Postby Kurt R » 21. October 2011 23:10

Well, my records indicate that I do have "A" name pointing to my IP address.

A, CNAME, AAAA RecordsHide Details
Modify your A, CNAME and AAAA records to send some domain traffic to a specific server. Learn More

Hostname Points To TTL (sec) Type Status

lambdacomputers.com. 98.155.10.208 300180036008640060480086400 A Published
Edit | Delete Processing...

mail ghs.google.com. 300180036008640060480086400 CNAME Published
Edit | Delete Processing...
Kurt R
 
Posts: 4
Joined: 21. October 2011 17:04
Operating System: Server 2008 R2

Re: Virtual Hosts not working for 2nd site

Postby JonB » 21. October 2011 23:43

I can't tell -- is that a "A" record, NOT the canonical domain name? (http://domainname.tld)

You may need an "A" hostname record for 'www'

If you only set it (an A record for www.lambdacomputers.com) up in the last 24-36 hours - you are dealing with "propagation lag">

This is what another DNS site says - Netcraft
http://uptime.netcraft.com/up/graph?sit ... puters.com
Site name or availability problem for http://www.lambdacomputers.com

We could not get any results for your selected site. There can be a several reasons for this:

The host name you have selected is not valid, perhaps it was mistyped.
We could not contact it, and we do not have any cached information for it. This can be because there is no server running on that site yet, or because it is a new site and the DNS has not yet propagated to Netcraft. It can be also be because of a temporary routing problem from Netcraft to the site.

We cannot tell you anything about this server, and have ignored it.

It is possible that you have mistyped the name. You can explore web server names here.


No matter what you say, think or rationalize - that is the core issue. - at this moment your 'www' subdomain/hostname cannot be resolved. It has nothing to do with XAMPP, Apache, or me.

http://www.mattcutts.com/blog/seo-advic ... alization/

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Virtual Hosts not working for 2nd site

Postby Kurt R » 22. October 2011 05:11

ok, that helped, I added the WWW a record and now those pesky errors from the intodns site are mostly gone.
And LC is mostly resolving to my server now...A bit new to the setup for these types of records, so Thank you for the info and the sites to reference.

I will update tomorrow.

Thanks again.
Kurt R
 
Posts: 4
Joined: 21. October 2011 17:04
Operating System: Server 2008 R2

Re: Virtual Hosts not working for 2nd site

Postby Sharley » 22. October 2011 05:18

An alternate to setting an A record would be to have the server handle the www in the httpd-vhosts.conf file, for example
Code: Select all
Servername lambdacomputers.com
ServerAlias www.lambdacomputers.com
Then the server will serve the site no matter which is typed in the browser and which is the normal way to do this especially for those not familiar with changing DNS record entries and some who don't even have access to the beast.

Best wishes.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 135 guests