Apache Site Shows With No VHost

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
{{Classic}}
A semi-regular
A semi-regular
Posts: 26
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Fri Feb 18, 2011 2:02 pm

Apache Site Shows With No VHost

Post by {{Classic}} »

Ok, so, still a n00b with setting up VHosts and all, but I'm curious how this is working...

So there is a new domain pointing to the server IP, but no VHosts are setup for this particular domain. When people enter in the URL, they see a website for another domain.

So, here's the thing... with no VHost setup, why are they seeing any page at all?

I setup a VHost for the domain, so now anyone visiting the URL is greeted with Forbidden... but I'm curious why this was needed.

Guess my question is, from someone more experienced with the Apache config, is this... does one of the sites in the config show up as a 'Default' site? Is there something I'm missing to deny access when there is no defined location for a domain, rather then people just being tossed to one of the other sites?

It's a bit late, I'm a bit tired, sorry if this isn't typed all correctly. Hope I made this clear, if not, I'll try to clarify if any questions are asked. Basically to sum it up... new domain with no vhost configured points to a different domain on the apache server, kinda like it defaults to it... how do I prevent this?
{{Classic}}
A semi-regular
A semi-regular
Posts: 26
Joined: Fri Feb 18, 2011 2:02 pm

Re: Apache Site Shows With No VHost

Post by {{Classic}} »

Replying with the fix... ;)

http://httpd.apache.org/docs/2.0/vhosts/examples.html

Under - Using _default_ vhosts

Problemo solved!
User avatar
Edge100x
Founder
Founder
Posts: 12958
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Apache Site Shows With No VHost

Post by Edge100x »

Thanks for posting a follow-up!
{{Classic}}
A semi-regular
A semi-regular
Posts: 26
Joined: Fri Feb 18, 2011 2:02 pm

Re: Apache Site Shows With No VHost

Post by {{Classic}} »

Edge100x wrote:Thanks for posting a follow-up!
No problem. May someone else save some time by reading this, if they have the similar setup.

Found out that with no default page, when it checks the VHosts, it will use the first defined one available, if none are found for a matching domain/port. I did not know that. Seems like it would just deny access and not allow any page to be served... but guess not. ^-^
Post Reply