Domain Name Service And Virtual Hosting

1. DNS Resource Records

2. Server configuration


3. BIND : The Berkeley Internet Name Domain

4. dynamic updates on dns entry

5. wildcard domain

6. virtual hosting

7. an Apache virtual host configuration example

#
# Use name-based virtual hosting.
#
NameVirtualHost ###.###.###.###

<VirtualHost ###.###.###.###>
#primary vhost
#         http://testie.test.com/blahblah => /test-domain/testie/blahblah (URI)
ServerName *.test.com
RewriteEngine On
RewriteCond      %{HTTP_HOST}        [^.]+\.test\.com$
RewriteRule      ^(.+)                %{HTTP_HOST}$1
RewriteRule      ([^.]+)\.test\.com(.*) /test-domain/$1$2
RewriteLog logs/rewrite.log
RewriteLogLevel 9
</VirtualHost>

<VirtualHost ###.###.###.###>
#secondary vhost
#     http://specific.javadom.com/blahblah => /home/javadom/blahblah (FILE PATH)
ServerName specific.javadom.com
#Redirect / http://specific.test.com/
RewriteEngine On
# $0 always means full token
RewriteRule (.*) /home/javadom/$1
RewriteLog logs/rewrite.log
RewriteLogLevel 9
</VirtualHost>

<VirtualHost ###.###.###.###>
#third vhost
#     http://baby.javadom.com/blahblah => /non-test-domain/baby.javadom.com/blahblah (URI)
ServerName *.javadom.com
RewriteEngine On
RewriteCond      %{HTTP_HOST}        !([^.]+\.test\.com$|specific\.javadom\.com)
RewriteRule      ^(.+)                %{HTTP_HOST}$1
RewriteRule      (.*)                /non-test-domain/$1
RewriteLog logs/rewrite.log
RewriteLogLevel 9
</VirtualHost>

8.