apache/dns question?
Kolya Matteo
bludiscuss-f4CcynXoCdkdnm+yROfE0A at public.gmane.org
Tue May 24 09:18:25 EDT 2011
On Tue, May 24, 2011 at 8:18 AM, Edward Ned Harvey <blu-Z8efaSeK1ezqlBn2x/YWAg at public.gmane.org> wrote:
>> From: discuss-bounces-mNDKBlG2WHs at public.gmane.org [mailto:discuss-bounces-mNDKBlG2WHs at public.gmane.org] On Behalf
>> Of Myrle Francis
>>
>> what I would like to configure instead is to have these webpages
> accessable
>> via http://user1.mafmanet.us, http://user2).mafmanet.us)
>>
>> Is there some reason why I would/should choose one convention over the
>> other?
>
> The advantage of the default configuration (using ~, not dns based) is that
> you don't have to configure any DNS, and you don't have to configure apache
> when you have new or removed users. Just create a user account and there it
> is.
The DNS configuration can be taken care of with a wildcard DNS record.
Essentially, you direct *.example.com to your IP. Then any
username.example.com would resolve to your server, which would return
username's site. Any nonexistent user would return a 404 (instead of
"can't find the server.")
A potential disadvantage to the name-based virtual hosts is that they
don't work with HTTP 1.0, only HTTP 1.1. (The problem is that HTTP
1.0 doesn't require the Host: header, so the server doesn't know what
hostname the client wants to talk to, only the IP, which is the same
for all the users.) I've used name-based virtual hosting for many
years without having this come up. There are some annoying
workarounds if you want stuff to work with HTTP 1.0 clients, but
they're not worth it IMHO. See
http://httpd.apache.org/docs/2.2/vhosts/name-based.html#compat
>
>> And can you please point me to some docs that would explain what I would
>> like to achieve and what it is formally called? (ie http redirection?)
>
> What you're looking for is called Name Based Virtual Host. It's already
> present in the default apache config (just go to the very end of the file)
> and start reading the associated documentation on apache.org.
>
> The way I see it, you have two options: You could leave the user settings
> as they are, and then you could use name based virtual hosting and
> redirection to forward the user1.foobar.com to foobar.com/~user1 ... Or
> you could simply eliminate the user settings, and create a name based
> virtual host that goes directly to each user's directory.
>
> _______________________________________________
> Discuss mailing list
> Discuss-mNDKBlG2WHs at public.gmane.org
> http://lists.blu.org/mailman/listinfo/discuss
>
More information about the Discuss
mailing list