Darxus on Wed, 3 May 2000 12:20:08 -0400 (EDT)


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

[PLUG] DNS & Apache wildcards


I had expected that when I posted on this subject, it would be a question.
But I've managed to find the answers, from N-tropy (thanks).

They actually turned out to be exactly what I would have expected, if I'd
just tried it.


DNS:

In the zone file for chaosreigns.com, I have a line:

*               IN      CNAME   @	; *.chaosreigns.com

after all my A records.  So if you try to resolve anything that's
specifically defined, it will resolve correctly.  Then if you do a
nslookup on anything that doesn't exist, say, aosdpro.chaosreigns.com,
it'll resolve it to the same IP address as chaosreigns.com.


Apache:

Then in the httpd.conf on that machine, the entry looks like:

<VirtualHost 209.71.111.42>
ServerName www.chaosreigns.com
ServerAlias chaosreigns.com *.chaosreigns.com
DocumentRoot /home/darxus/public_html
ErrorLog /var/log/apache/www.chaosreigns.com-error.log
TransferLog /var/log/apache/www.chaosreigns.com-access.log
</VirtualHost>

So I learned 2 things here... you can define 2 hostnames on 1 SeverAlias
line ("chaosreigns.com" & "*.chaosreigns.com"), instead of having to
create multiple entire VirtualHost entries, and.. you can do wildcards.

So if you type in anyvalidstring.chaosreigns.com into your web browser,
it'll load my stuff.

__________________________________________
darxus@op.net / http://www.ChaosReigns.com


______________________________________________________________________
Philadelphia Linux Users Group       -       http://plug.nothinbut.net
Announcements - http://lists.nothinbut.net/mail/listinfo/plug-announce
General Discussion   -   http://lists.nothinbut.net/mail/listinfo/plug