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 Hosts 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
 
With apache, if you have more than one host, you must use vhost for all of them. The main server will never be served. The default is the first vhost defined. If you are using the same ip for all domains, then you need to use name based addressing and must put the ServerName directive in each vhost container. Each should also have it's own DocumentRoot. This is the directory where the web pages for that site are.
 
Thanks! I was wondering if it might be something like that, thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top