Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual Host overriding the Main server?

Status
Not open for further replies.

ElectusUnum

Technical User
May 24, 2002
16
0
0
US
I'm running Apache 2.0 on Win XP, I'm new to it, but I've learned a lot and am continuing to learn quickly. My problem is this: I have setup two virtual hosts. blam.revera.org using htdocs/blam/ and using htdocs/ . Whichever virtual host is entered FIRST in the config file is the one that people recieve when they visit revera.org (the main server) . My main server is revera.org, and I've solved the problem by entering (same root folder as revera.org should be) first in the config file so revera.org doesnt give you the site for the blam subdomain. Is this the only way to fix it? It seemed to me that my main server is/should be seperate from the virtual hosts. The problem is fixed, but I would like it to function the way it should instead of using a work-around :^/ . Any help is greatly appreciated!
-ElectusUnum
 
Hi mate,

Once you add a virtualhost, the main server is useless. If you want to add a site to an existing set-up then you need to have all sites as virtualhosts.

The default domain is the first virtualhost. If a request is made for an unknown server name or Apache for some reason cannot read it, the first virtualhost is called.

Hope this helps Wullie

 
If you enter in just yourdomain.com, and not sometimes the server won't recognize it. Try addding the following line to each of your virtual host configurations.

ServerAlias yourdomain.com *.yourdomain.com

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top