You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Behlendorf <br...@hyperreal.org> on 1999/01/05 04:05:16 UTC

Re: mass vhosting, was Re: [STATUS] (apache-1.3) Sun Jan 3 23:45:22 EST 1999

At 04:27 PM 1/4/99 +0000, Tony Finch wrote:
>I have a text file (below) which I'll HTMLise if you like it. A couple
>of the examples are derived from 
>http://www.engelschall.com/pw/apache/rewriteguide/

This is really good; if you HTMLize it I'll commit it next to the other
vhost documentation.

>Would it be sensible to force hostnames and ServerNames to be all
>lower case? It would make handling this sort of thing slightly simpler
>:-)

Yep, sounds good to me.  Some comments...

>A couple of things need to be `faked' to make the dynamic virtual host
>look like a normal one. The most important is the ServerName, and the
>way it is determined is controlled by the UseCanonicalName directive.
>With UseCanonicalName off the ServerName comes from the contents of
>the Host: header in the request. If there is no Host: header then the
>configured ServerName is used instead; this can be used to provide a
>default virtual host which might allow backwardly compatible access to
>the dynamic virtual hosts.

There are lots of hidden problems with trying to do that though; forcing
non-'/'-rooted relative pathnames in all your HREF links is one, but I'm
sure there are other more subtle ones, and ServerPath does a good job at
addressing it, but still I worry about "new feature pressure" that such a
suggestion might entail.  I don't think it'd be unreasonable to suggest
instead that non-Host:-header browsers are just out of luck.  I mean, what
are we talking about here?  netscape pre-2.0, msie pre-3.0, lynx pre-2.4,
what else?  I can't imagine it's more than 2% of traffic this days.  All
I'm addressing here is the recommendation that would be in this doc.

I'm sure the #1 question people will have after they implement it is, "I
want to set 'Redirect /blah /blah' for a certain vhost.  How do I do that
under this system?" which I guess the answer to is "two ways: do an
explicit <VirtualHost> section, or use a .htaccess in that vhost's dir."

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
History is made at night;                         brian@hyperreal.org
  character is what you are in the dark.

Re: mass vhosting, was Re: [STATUS] (apache-1.3) Sun Jan 3 23:45:22 EST 1999

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

On Wed, 6 Jan 1999, Martin Pool wrote:

> Why is it necessary to copy the Directory structures for each vhost?
> Couldn't global <Directory> configs just be shared across all of them?

It isn't necessary -- and they aren't copied... or at least they're not
supposed to be that I can remember.  Looking at the code it doesn't look
like it copies them, it copies pointers to the directory structures, but
doesn't copy the structures themselves. 

There's essentially no "copy this dir/vhost config" primitive in the
module interface, so it'd be like totally impossible to copy things.
There's only "create a new dir/vhost config" and "merge these two
dir/vhost configs".  And no, it doesn't create a new and merge to do a
"copy".

But if you use the srm.conf or access.conf files, there is some crap that
happens -- I just suggest not using them.  It rereads those files for each
vhost or some other such silliness.  So if the dir sections were in one of
those files, then yeah it'd be duplicated. 

Dean


Re: mass vhosting, was Re: [STATUS] (apache-1.3) Sun Jan 3 23:45:22 EST 1999

Posted by Martin Pool <mb...@wistful.humbug.org.au>.
On Mon, Jan 04, 1999 at 07:05:16PM -0800, Brian Behlendorf wrote:
> At 04:27 PM 1/4/99 +0000, Tony Finch wrote:
> >I have a text file (below) which I'll HTMLise if you like it. A couple
> >of the examples are derived from 
> >http://www.engelschall.com/pw/apache/rewriteguide/

If I understand correctly, the problem with configurations like this:

  <Directory /home/mbp>
    ...
  </Directory>

  <VirtualHost 1.2.3.4:80>
    ServerName mbp.victim.com
    ServerRoot /home/mbp
    ...
  </VirtualHost>

  <Directory /home/cjp>
    ...
  </Directory>

  <VirtualHost 1.2.3.4:80>
    ServerName cjp.victim.com
    ServerRoot /home/cjp
    ...
  </VirtualHost>

  [repeated many times]

is that memory usage goes up as the product of the number of
<Directory> and <VirtualHost> configurations, because Apache copies
the Directory entries for each VirtualHost.  (I remember reading a PR
about this where the answer was basically "don't do that then", plus a
suggestion to use rewrites instead.)

Why is it necessary to copy the Directory structures for each vhost?
Couldn't global <Directory> configs just be shared across all of them?

-- 
Martin Pool

Re: mass vhosting, was Re: [STATUS] (apache-1.3) Sun Jan 3 23:45:22 EST 1999

Posted by Brian Behlendorf <br...@hyperreal.org>.
At 11:24 AM 1/5/99 +0000, Tony Finch wrote:
>Brian Behlendorf <br...@hyperreal.org> wrote:
>>This is really good; if you HTMLize it I'll commit it next to the other
>>vhost documentation.
>
>Thanks. Shall I send it to the list or to you directly?

Just send it directly, once it's in CVS people will still have a chance to
comment and change things.

>>I'm sure the #1 question people will have after they implement it is, "I
>>want to set 'Redirect /blah /blah' for a certain vhost.  How do I do that
>>under this system?" which I guess the answer to is "two ways: do an
>>explicit <VirtualHost> section, or use a .htaccess in that vhost's dir."
>
>I'll include something like this too -- I think I need to make it
>clearer that mod_rewrite overrides mod_alias etc. so care needs to be
>taken with using features provided by it.

That would be great.  Maybe we could even distribute a separate, modified
httpd.conf-dist, that shows what can & can't be done, a la
highperformance.conf-dist.

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
History is made at night;                         brian@hyperreal.org
  character is what you are in the dark.

Re: mass vhosting, was Re: [STATUS] (apache-1.3) Sun Jan 3 23:45:22 EST 1999

Posted by Tony Finch <do...@dotat.at>.
Brian Behlendorf <br...@hyperreal.org> wrote:
>Tony Finch wrote:
>>
>>I have a text file (below) which I'll HTMLise if you like it. A couple
>>of the examples are derived from 
>>http://www.engelschall.com/pw/apache/rewriteguide/
>
>This is really good; if you HTMLize it I'll commit it next to the other
>vhost documentation.

Thanks. Shall I send it to the list or to you directly?

>>If there is no Host: header then the configured ServerName is used
>>instead; this can be used to provide a default virtual host which
>>might allow backwardly compatible access to the dynamic virtual
>>hosts.
>
>There are lots of hidden problems with trying to do that though;
>forcing non-'/'-rooted relative pathnames in all your HREF links is
>one, but I'm sure there are other more subtle ones, and ServerPath
>does a good job at addressing it, but still I worry about "new
>feature pressure" that such a suggestion might entail.

Yes, that should be mentioned because it's easily overlooked. I have a
sneaking suspicion that mod_rewrite could be persuaded to do something
like a dynamic ServerPath, but there are all sorts of reasons why this
isn't worth it: it requires co-operation from customers to work and
therefore it frequently won't; it causes cache pollution by causing
multiple URLs to refer to the same resource; etc.

>I don't think it'd be unreasonable to suggest instead that
>non-Host:-header browsers are just out of luck. I mean, what are we
>talking about here? netscape pre-2.0, msie pre-3.0, lynx pre-2.4,
>what else?

Broken robots, but we hardly care about them.

>I'm sure the #1 question people will have after they implement it is, "I
>want to set 'Redirect /blah /blah' for a certain vhost.  How do I do that
>under this system?" which I guess the answer to is "two ways: do an
>explicit <VirtualHost> section, or use a .htaccess in that vhost's dir."

I'll include something like this too -- I think I need to make it
clearer that mod_rewrite overrides mod_alias etc. so care needs to be
taken with using features provided by it.

Tony.
-- 
f.a.n.finch  dot@dotat.at  fanf@demon.net