[sllug-members]: httpd.conf question
Jason Edwards
jtanium at gmail.com
Tue Aug 14 12:26:25 MDT 2007
On 8/14/07, Lamont Peterson <lamont at gurulabs.com> wrote:
> On Monday 13 August 2007 10:02pm, Clint Savage wrote:
> > On 8/13/07, Adam Barrett <dragen at gmail.com> wrote:
> > > I am going to be setting up a bunch of domains to redirect to one...
> > > is this a valid VirtualHost entry?
> > >
> > > <VirtualHost *>
> > > ServerName www.domain.com
> > > ServerAlias *.domain.*
> > > DocumentRoot /my/domain
> > > </VirtualHost>
> > >
> > > Would that capture all the .net .org .biz etc? Or would it fail
> > > miserably?
> >
> > According to the documentation on apache's site[1], this would
> > probably work. My recommendation would to be to add one entry for
> > each to be explicit. Its possible that if you own x.domain.org, you
> > may want it to be managed elsewhere at some point.
>
> That's excellent advice. However, there's a more important reason to never do
> do "*.domain.*"; That would be trying to match on *anything* and I doubt
> you've registered "domain" in ever TLD there is. Remember, there are all the
> ISO country codes (over 300 of them) plus things
> like .com, .net, .org, .int, .mil, .gov, .biz, .info, .name, .mobi, etc. You
> do not want your server handling domains that you haven't registered. Many
> web applications could experience (typically minor) difficulties if you do.
Theoretically, yes. But in practice, it shouldn't make any
difference. This is a name based VirtualHost, so the only time Apache
is going to care is when it receives a request with the given domain.
If you haven't registered the domain, then the DNS won't be pointed to
your server, so it shouldn't be receiving those requests.
That being said, I always explicitly state my tld's...
Jason
>
> > Also, I'd suggest you consider making sure that you cover domain.com
> > as well. To me, its smart to make sure that your domain.com and
> > www.domain.com point to the same data. Its easy to do and I wonder
> > why more people don't.
> >
> > Here's what I'd do:
> >
> > <VirtualHost *:80>
> > ServerName www.domain.com
> > ServerAlias domain.org domain.biz domain.net domain.com
> > *.domain.com *.domain.org *.domain.biz
> > DocumentRoot /my/domain
> > </VirtualHost>
> >
> > I'm not sure why, but that still bugs me, though it should technically
> > be correct. Probably just my eccentricity shining through. o_O
>
> Possibly because you would be handing out the exact same content for different
> domains. If you want your other domains to all point to www.domain.com, I
> would create two virtual hosts where the first is for www.domain.com and the
> second would have the ServerAlias list and a redirect to www.domain.com.
>
> > 1- http://httpd.apache.org/docs/2.2/mod/core.html#serveralias
> [snip]
> --
> Lamont Peterson <lamont at gurulabs.com>
> Senior Instructor
> Guru Labs, L.C. [ http://www.GuruLabs.com/ ]
>
> NOTE: All messages from this email address should be digitally signed with my
> 0xDC0DD409 GPG key. It is available on the pgp.mit.edu keyserver as
> well as other keyservers that sync with MIT's.
>
> ______________________________________________________________________
> See http://www.sllug.org/ for latest SLLUG news, information, links.
> Join SLLUG and other UT LUG members on irc.FreeNode.net channel #Utah
> sllug-members at sllug.org
> http://www.sllug.org/cgi-bin/mailman/listinfo/sllug-members
>
>
>
More information about the sllug-members
mailing list