OK,
I assume that you have registered the domain and configured BIND8 so that
you are the nameserver for your domain. You will have to create BIND
entries for all the machines you want to have under your domain, www, mike,
etc. I'll leave that info to someone more experienced with BIND however.
To use name-based virtual hosts in Apache, you will need the following line
before your first VirtualHost definition:
NameVirtualHost <IP-address>
Where <IP-address> is the IP address of your machine.
I suggest something like the following (assuming that your machine's IP is
199.182.49.39 and you are using name-based vhosts), although I'm not sure of
the specifics of your setup...
NameVirtualHost 199.182.49.39
<VirtualHost 199.182.49.39>
DocumentRoot /usr/local/www/data
ServerName www.atmontereybay.com
ErrorLog /var/log/www_error_log
CustomLog /var/log/www_access_log
</VirtualHost>
<VirtualHost 199.182.49.39>
DocumentRoot /usr/local/www/mike/htdocs
ServerName mike.atmontereybay.com
ErrorLog /var/log/mike_error_log
CustomLog /var/log/mike_access_log
</VirtualHost>
You should have to worry about the localhost. Bear in mind that once you
put in the NameVirtualHost directive, you can ONLY have virtual hosts, the
default host will no longer work. This config also lets you log your
different subdomains separately...
Chris
> I'm running apache 1.3.9 on FreeBSD 3.3. I registered a domain and have
all
> that working correctly ( I think). It is www.atmontereybay.com. Now I
want
> to add virtual domains. for example mike.atmontereybay.com.
> I created aliases in the rc.conf, and added the following to httpd.conf
> <VirtualHost localhost.atmontereybay.com>
> DocumentRoot /usr/local/www/data
> ServerName localhost.atmontereybay.com
> </VirtualHost>
> <VirtualHost www.atmontereybay.com>
> ServerName www.atmontereybay.com
> DocumentRoot /usr/local/www/data
> </VirtualHost>
> <VirtualHost 199.182.49.39>
> ServerName mike.atmontereybay.com
> DocumentRoot /usr/local/www/mike/htdocs
> </VirtualHost>
> If I try to access mike.atmontereybay.com, I get the www.atmontereybay.com
> page. The index.html file in /usr/local/www/mike/htdocs reads "Can you
see
> this". I also tried using <VirtualHost mike.atmontereybay.com> instead of
> the ip address but the results were the same- it brought up
> www.atmonterebay.com.
> Can anyone help me get beyond this?
> Thanks in advance,
> Mike Gideon