[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: virtual hosts



Thom May <thom@debian.org> writes:

> * David N. Welton (davidw@dedasys.com) wrote :

> > Two questions:

> > 1) Could the symlink to the 'default' site be called something
> > like 000default, so that it's really the default?  Or maybe it
> > should just be included first?

> Hrmm. could you submit this as a wishlist bug?  I'm against this in
> principle, just need a way of reminding myself.

Well, if you're against it... why bother filing a bug report just to
close it?  I'd at least like to hear what's wrong with it.  What I
think is right with it is this (from the docs at
http://localhost/doc/apache2-doc/manual/vhosts/name-based.html):

        Main host goes away

        If you are adding virtual hosts to an existing web server, you
        must also create a <VirtualHost> block for the existing
        host. The ServerName and DocumentRoot included in this virtual
        host should be the same as the global ServerName and
        DocumentRoot. List this virtual host first in the
        configuration file so that it will act as the default host.

The problem I foresee is that people see something called 'default',
and in many cases ('default' sorts pretty early) it will work, but
then occassionally it won't, and they'll get confused.

Also, IMO, there is enough 'architecture' in the config directory that
a short README would be in order.  I can try and put something
together if that would be helpful.

> > 2) Not strictly Debian related...

> >    http://localhost/doc/apache2-doc/manual/vhosts/name-based.html

> >    Gives some vhost examples for apache2 - when following them, I
> >    get this warning: [warn] NameVirtualHost *:0 has no
> >    VirtualHosts, although everything seems to work ok.

> so you have:
> NameVirtualHost 1.1.1.1:80
> <VirtualHost 1.1.1.1:80>
> ...
> </VirtualHost> ?
> Or something else?
> Cheers

As per the URL cited above, I have something akin to the following:

NameVirtualHost *

<VirtualHost *>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>

<VirtualHost *>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>

Thanks,
-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/



Reply to: