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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help w/order of multiple virtual named servers?

Status
Not open for further replies.

BobMCT

IS-IT--Management
Sep 11, 2000
756
0
0
US
On my apache2 instance I have about a dozen named virtual servers. I am having difficulties sometimes with which virtual server gets served to the client. Hopefully someone can provide an explanation for the order/precedence what determines WHICH virtual servier receives the request.

Most of my named virtual sites begin with <virtualhost *> or <virtualhost *:80> .

I've searched this forum, others, the apache frieds site and other apache books but cannot locate a definitive explanation of how apache determines the precedence.

So, would someone please provide a good link -OR- provide a good explanation?

Thank you very much.
 
Hi

Name-based Virtual Host Support in the documentation explains the basics. In few words :
[ul]
[li]In HTTP 1.1 protocol the user agent sends a HTTP request header : [tt]Host: name_of_virtual_server[/tt].[/li]
[li]If name_of_virtual_server is found in the [tt]ServerName[/tt] or [tt]ServerAlias[/tt] directive of any [tt]VirtualHost[/tt] section, that virtual host will process the request.[/li]
[li]If name_of_virtual_server is not found, the first virtual host will process the request.[/li]
[li]In HTTP 1.0 there was no [tt]Host[/tt] HTTP request header, so name_of_virtual_server can not be sent and always the first virtual host will process the request.[/li]
[/ul]
As the virtual host's name should be unique, no other rule is needed to decide to which one was sent the request.

Not sure if this explained anything you were interested in.


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top