maximum non-ip virtual hosts with apache?

maximum non-ip virtual hosts with apache?

Post by Supernews Us » Fri, 22 Jan 1999 04:00:00



Does anybody know how many non-ip based virtual hosts I can support with
Apache 1.3.3 using Solaris 2.6.  I've got a whole bunch of RAM (1gig).  Is
there are rule of thumb I can use to come up with a sane maximum number?

Thanks,
Paul Yasi

   -**** Posted from Supernews, Discussions Start Here(tm) ****-
http://www.supernews.com/ - Host to the the World's Discussions & Usenet

 
 
 

maximum non-ip virtual hosts with apache?

Post by Marc Slemk » Sat, 23 Jan 1999 04:00:00



Quote:>Does anybody know how many non-ip based virtual hosts I can support with
>Apache 1.3.3 using Solaris 2.6.  I've got a whole bunch of RAM (1gig).  Is
>there are rule of thumb I can use to come up with a sane maximum number?

You can support 59840 vhosts.  In reality, the number varies a lot
and there is no way to give a hard number.  With Solaris with many
vhosts, you will need lots of swap because Solaris won't overcommit
swap so you end up reserving but never allocating or using a lot
of swap.  Apache doesn't have any limits, although there is some
O(n) code there in the number of vhosts.  Using IP based vhosts, Apache
can keep the vhosts in a hash table and make it more efficient, but
it can't do that with name based vhosts.

As always, when having a large number of vhosts avoid having a large
number of config directives that are inherited from the main server
by each vhost when you don't really want them to apply there; eg.
if you have 10000 Alias directives for various directories in the
main server, then they would by default be inherited by each vhost
config and eat a lot of memory.  To avoid that, put the main server in
a vhost itself.

However, if you are just using simple vhosts then a better solution would
be to use mod_rewrite and not use real vhosts at all, then you can scale
forever.  See http://www.apache.org/docs/vhosts/mass.html for details.
(haven't read the above document yet, so I can't say if it is
good or not, but concept discussed works fine in many situations)

 
 
 

maximum non-ip virtual hosts with apache?

Post by John Hasca » Wed, 27 Jan 1999 04:00:00



Quote:}However, if you are just using simple vhosts then a better solution would
}be to use mod_rewrite and not use real vhosts at all, then you can scale
}forever.  See http://www.apache.org/docs/vhosts/mass.html for details.
}(haven't read the above document yet, so I can't say if it is
}good or not, but concept discussed works fine in many situations)

    I can vouch for the concept.

    An ISP customer of mine has been using a similarly-modified
    CERN httpd for several years doing this (not having
    mod_rewrite's flexibility, this server just blindly prepends
    the incoming destination IP address to the URL):

          /foodir/blah.html     -=>   /192.168.1.2/foodir/blah.html

    (and sets SERVER_HOST for CGIs and prepends it to the access_log too).
    As you can see this server predates name-based virtual hosts,
    but that would be even easier.

    This is a good technique and it scales very well indeed
    -- it is O(1) complexity, uses no extra file descriptors,
    and basically no memory.

John
--
John Hascall, Software Engr.      Shut up, be happy.  The conveniences you
ISU Computation Center            demanded are now mandatory. -Jello Biafra

http://www.cc.iastate.edu/staff/systems/john/index.html  <=- the usual crud

 
 
 

maximum non-ip virtual hosts with apache?

Post by Marc Slemk » Thu, 28 Jan 1999 04:00:00



Quote:>    I can vouch for the concept.
>    An ISP customer of mine has been using a similarly-modified
>    CERN httpd for several years doing this (not having
>    mod_rewrite's flexibility, this server just blindly prepends
>    the incoming destination IP address to the URL):
>          /foodir/blah.html     -=>   /192.168.1.2/foodir/blah.html
>    (and sets SERVER_HOST for CGIs and prepends it to the access_log too).
>    As you can see this server predates name-based virtual hosts,
>    but that would be even easier.
>    This is a good technique and it scales very well indeed
>    -- it is O(1) complexity, uses no extra file descriptors,
>    and basically no memory.

The other cool thing about it is that, if you want hostnames all
under a given domain, you can even have it all work automagically for
every user without any user-specific config by using wildcard DNS
records.

eg. if *.user.znep.com was a wildcard A record pointing to some IP
address, then http://joe.user.znep.com could automatically look in
~joe/public_html (or, obvious, whereever you configure it),
bob.user.znep.com could automatically look in ~bob/public_html, etc.
Just like magic, zero overhead virtual domains for all your 5 million
customers who, for some reason, think that joe.user.znep.com is cooler
than user.znep.com/~joe/

Then you don't even have to configure the DNS server for each domain.

(I wouldn't necessarily recommend using wildcard A records for this,
since they have numerous sometimes hidden drawbacks and it is pretty
trivial for any modern nameserver to support many hundreds of
thousands of hosts in a domain without much problem, but it is a
conceptually cool idea)

 
 
 

maximum non-ip virtual hosts with apache?

Post by john chapm » Thu, 28 Jan 1999 04:00:00


Marc,

I am NOT an expert on this, and I have read enough of your posts, and
seen that you had credit by microsoft for a frontpage security bug-
but, using wildcard aliases will really*up the new sendmail I
believe. Correct me if I am wrong.

Thanks,

John Chapman

Quote:

>(I wouldn't necessarily recommend using wildcard A records for this,
>since they have numerous sometimes hidden drawbacks and it is pretty
>trivial for any modern nameserver to support many hundreds of
>thousands of hosts in a domain without much problem, but it is a
>conceptually cool idea)

 
 
 

maximum non-ip virtual hosts with apache?

Post by Tony Finc » Thu, 28 Jan 1999 04:00:00



>    I can vouch for the concept.

>    This is a good technique and it scales very well indeed
>    -- it is O(1) complexity, uses no extra file descriptors,
>    and basically no memory.

We've been using this technique in a locally modified thttpd for about
two and a half years, and the machine now has over 66,000 virtual
hosts and is going strong.

Tony.
--

 
 
 

maximum non-ip virtual hosts with apache?

Post by Marc Slemk » Thu, 28 Jan 1999 04:00:00



Quote:>Marc,
>I am NOT an expert on this, and I have read enough of your posts, and
>seen that you had credit by microsoft for a frontpage security bug-
>but, using wildcard aliases will really*up the new sendmail I
>believe. Correct me if I am wrong.

There are various issues to be dealt with, but they can be dealt with.
First, just because you have that hostname available for web use doesn't
necessarily mean it has to handle email as well.  If you do want it
to handle email, then it can take a bit of doing to make everything
work properly and there are some possible major pitfalls to using
wildcard A records, which is part of the reason I don't really
recommend doing things that way, but with the appropriate care most of
them can be avoided most of the time.
Quote:>Thanks,
>John Chapman

>>(I wouldn't necessarily recommend using wildcard A records for this,
>>since they have numerous sometimes hidden drawbacks and it is pretty
>>trivial for any modern nameserver to support many hundreds of
>>thousands of hosts in a domain without much problem, but it is a
>>conceptually cool idea)

 
 
 

maximum non-ip virtual hosts with apache?

Post by Christopher Schul » Thu, 28 Jan 1999 04:00:00



Quote:>There are various issues to be dealt with, but they can be dealt with.
>First, just because you have that hostname available for web use doesn't
>necessarily mean it has to handle email as well.  If you do want it
>to handle email, then it can take a bit of doing to make everything
>work properly and there are some possible major pitfalls to using
>wildcard A records, which is part of the reason I don't really
>recommend doing things that way, but with the appropriate care most of
>them can be avoided most of the time.

Not really a web server issue, but:

Usually service providers will have one central server that does mail
routing for all their virtual domains, with the use of the MX record
in DNS.


                IN      MX      50      mail2.hosting-isp.net.

And even if the web server is doing mail, all that it needs is a
mailer configured to accept mail for an xyz.com domain.  That's very
easy to set up.  Then MX records just point over to the other server.

--
Christopher Schulte

Replace usenet with chris to send mail.

will *never* get to me. I hate spam!

 
 
 

1. Apache- Non-IP Virtual Hosts

Greetings,

I have a question about VirtualHost'ing options on Apache 1.1.3.  I have
had success using the <VirtualHost> option without a dedicated IP (yes,
I know the pros and cons) for non-critical domain hosting.

This has worked well for for www.domain.com however, I would like the
domain to be accessible via either domain.com and www.domain.com. I have
read the relevant document at apache.org, and it states that I should
use the ServerAlias command within the VirtualHost tags.

I have tried the following:

<VirtualHost domain.com>
ServerAlias domain.com *.domain.com
...other stuff...
</VirtualHost>

<VirtualHost www.domain.com>
ServerAlias domain.com *.domain.com
...other stuff...
</VirtualHost>

The DNS records contain A records for both domain.com and www, both of
which point to the servers IP.

The above both yield the correct results when trying www.domain.com, but
return the servers main page when trying just domain.com.

Any ideas?

Thanks,

S. William Schulz

2. how to license VisionFS (OSR5.05) ?

3. Newbie question: Apache 1.1x or 1.2x for non-ip virtual host

4. ghastly noise from audio on U-30 apres workman

5. Definitive conf for Apache 1.1.1 non-IP Virtual Hosting ?

6. agpgart

7. Non-IP Virtual Host with Apache

8. Why won't my NN work?........

9. Apache non-IP Virtual Host and AOL

10. Apache server config for non IP based virtual host

11. ApacheSSL 1.2b8/0.6.6 Non-IP Virtual Hosts

12. non-IP virtual hosting

13. non-ip based virtual hosting