You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Lars Eilebrecht <La...@unix-ag.org> on 1997/10/29 03:09:57 UTC

Draft: vhosts-in-depth and vhost-examples

Hi,

ok, here we go for a _first_ draft for the new vhosts-in-depth document
and a new vhost-example document containing some common (and maybe
uncommon ;-)) examples.

I'm currently not very happy with the vhosts-in-depth document, because
I'm still confused by some things (i.e. the fullURI stuff), but I
think Dean probably has some comments on the document. :)

The attachments include the documents in text format (I'll post the final
docs in HTML of course...).


ciao...
-- 
Lars Eilebrecht                       - Death is a nonmaskable interrupt.
sfx@unix-ag.org
http://www.si.unix-ag.org/~sfx/

Re: Draft: vhosts-in-depth and vhost-examples

Posted by Dean Gaudet <dg...@arctic.org>.

On Fri, 31 Oct 1997, Lars Eilebrecht wrote:

> According to Martin Kraemer:
> 
> [...]
> >  Is it really true that Port based vhosts don't need a NameVirtualHost?
> >  That was always unclear to me.
> 
> Ask Dean ;-)
> My tests showed that it work without NameVirtualHost...

They don't need namevirtualhost.  Unless you want to actually run a
name-based vhost on another port. 

> [...]
> >  I never tried this, but from looking at the code it appears to me that
> >  this should read "ServerPath /abc/def"
> 
> Yep, that's true.

Oh interesting... I guess that bug got fixed at some point.  It used to be
that "ServerPath /abc" would match /abcdef.

Dean


Re: Draft: vhosts-in-depth and vhost-examples

Posted by Lars Eilebrecht <La...@unix-ag.org>.
According to Martin Kraemer:

> >   IP-based vhosts only
> >   
>  ...
> >        Server configuration:
> >        
> >     ...
> >     Port 80
>  
>        Listen 80     <------- Add "Listen" to every "Port"?


If we only deal with Port 80 we don't need an explicit Listen directive
(IMHO).

> >      The main server can never catch a request, because all IP address
> >      of our machine are in use for IP-based virtual hosts.
>  
>  How about "localhost"? It will be served by the supposedly unreachable
>  main server.

Ah, I forgot about localhost... but I think most servers are rarely access
as localhost. ,-)

>  Shouldn't the examples include _default_s or at least a pointer to it?

You mean adding a _default_ vhost to very example? Well, I intentionally
added a paragraph about _default_ vhosts with example sections that can 
be used in one of the other examples if they are need... and only when
they are need. If have a server with one IP and use it for name-based
vhosts (and also specify "NameVirtualHost 127.0.0.1 :-)) then a _default_
vhost (or the main server) never serves a request.

[...]
>  Is it really true that Port based vhosts don't need a NameVirtualHost?
>  That was always unclear to me.

Ask Dean ;-)
My tests showed that it work without NameVirtualHost...
  
[...]
>  I never tried this, but from looking at the code it appears to me that
>  this should read "ServerPath /abc/def"

Yep, that's true.


ciao...
-- 
Lars Eilebrecht                     - Out of coffee--error. Programmer halted.
sfx@unix-ag.org
http://www.si.unix-ag.org/~sfx/

Re: Draft: vhosts-in-depth and vhost-examples

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Wed, Oct 29, 1997 at 03:09:57AM +0100, Lars Eilebrecht wrote:
> ok, here we go for a _first_ draft for the new vhosts-in-depth document
> and a new vhost-example document containing some common (and maybe
> uncommon ;-)) examples.

Very good, Lars! I always missed an examples document!

>        
> Examples
> 
>      * IP-based vhosts only
>      * Name-based vhosts only
>      * Mixed name-/IP-based vhosts
>      * Port-based vhosts
>        
>      * Using a _default_ vhosts
	       ^-delete
       * Using _default_ vhosts

...
>      _________________________________________________________________
>    
>   IP-based vhosts only
>   
...
>        Server configuration:
>        
>     ...
>     Port 80

      Listen 80     <------- Add "Listen" to every "Port"?

...
>      The main server can never catch a request, because all IP address
>      of our machine are in use for IP-based virtual hosts.

How about "localhost"? It will be served by the supposedly unreachable
main server. Shouldn't the examples include _default_s or at least a pointer
to it?

>      _________________________________________________________________
>    
>   Port-based vhosts
...
>     Listen 80
>     Listen 8080

Is it really true that Port based vhosts don't need a NameVirtualHost?
That was always unclear to me.

....

>      vhost with a wildcard port) catches all requests that where sent to
							     ^^^^^were

>      an unspecified IP address. The main server is never used to serve a
>      request.
> 
....

>               An In-Depth Discussion of Virtual Host Matching
>                                       
....
>     Absolute URI
>     
>    The URI from the request is check if it is an absolute URI, that is it
				 ^^^^^ed...
>    includes http://hostname/, then an attempt is made to determine if the
>    hostname's address (and optional port) match that of the connection vhost

How about something along the lines of:

If the request is an absolute URI, and its hostname and port match the main
server or one of the configured virtual hosts, then the scheme/hostname/port
prefix is stripped of and the remaining relative URI is served by the
corresponding vhost. (If no configured main/virtual server matches the given
hostname and port, the request is taken to be a proxy request.)
If the request contained a relative URI, a similar search is made for the
value of the Host: header field.

...
>   Tips
>   
>      * Avoid ServerPaths which are prefixes of other ServerPaths. If you
>        cannot avoid this then you have to ensure that the longer (more
>        specific) prefix vhost appears earlier in the configuration file
>        than the shorter (less specific) prefix (i.e., "ServerPath /abc"
>        should appear after "ServerPath /abcdef").
					 ^^^^^^^
I never tried this, but from looking at the code it appears to me that this
should read "ServerPath /abc/def"

Just my $.02

    Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: Draft: vhosts-in-depth and vhost-examples

Posted by Dean Gaudet <dg...@arctic.org>.
Ok I just posted some comments ... what I'd also like to see is for all
the vhost related documents to be moved into a new subdir
htdocs/manual/vhosts.  This might make it easier to place and find all the
vhost info.

The fullURI stuff is obtuse and marginally broken, Martin is working on
a patch that makes it clearer and correct.  We should wait for his patch
before documenting it.

Dean

On Wed, 29 Oct 1997, Lars Eilebrecht wrote:

> Hi,
> 
> ok, here we go for a _first_ draft for the new vhosts-in-depth document
> and a new vhost-example document containing some common (and maybe
> uncommon ;-)) examples.
> 
> I'm currently not very happy with the vhosts-in-depth document, because
> I'm still confused by some things (i.e. the fullURI stuff), but I
> think Dean probably has some comments on the document. :)
> 
> The attachments include the documents in text format (I'll post the final
> docs in HTML of course...).
> 
> 
> ciao...
> -- 
> Lars Eilebrecht                       - Death is a nonmaskable interrupt.
> sfx@unix-ag.org
> http://www.si.unix-ag.org/~sfx/
>