[sllug-members]: httpd.conf question

Clint Savage herlo1 at gmail.com
Mon Aug 13 22:02:42 MDT 2007


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.

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

1- http://httpd.apache.org/docs/2.2/mod/core.html#serveralias

Cheers,

Clint


More information about the sllug-members mailing list