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

Sum: Zone files for Bind 9 & Apache Virtual Domain conf



Hi All,


MAny thanks for the file Tyler, it was EXACTLY what I needed.  And thanks also to Leonard who pointed me to the DNS-Howto.   Now why didn't I think of that?<grins>


Andy


 



-----Original Message-----
From:	"redhat-install-list-admin redhat com" <redhat-install-list-admin redhat com> on behalf of	"Tyler Nally" <tnally iquest net>
Sent:	16 June 2001 17:15
To:	"redhat-install-list redhat com" <redhat-install-list redhat com>
Subject:	Re: Zone files for Bind 9 & Apache Virtual Domain conf

> I'm trying to set up a name server for my machine, but I have so much
documenation for BIND here that I am getting quite confused.
>
> Could someone give me an example zone file that will allow me to use
>
> www.mydomain.com   -  my main web server
> www.subdomain.mydomain.com  - virtual web site on same ip address
> mydomain.com   -  my registered domain
> myserver.mydomain.com   -  my registered nameserver
> second.otherdomain.com  -  my secondary name server
> third.otherdomain.com  -  my other secondary name server

This is the way I do a *single* domain with several different
virtual webservers hosted on the same machine.  Each domain has it's
own zone file....  So, if there are other zone files, then each zone
file will have it's own information for each individual set of zone
information.

This is zone file of one virtual domain (mainvirtdomain) which is
hosted on a host machine (hostdomain).  This is the zone entry file
that's found in /var/named on the ns1.hostdomain.net as well as the
backup name server ns2.hostdomain.net.  It should be the top level
domain registration spot on the net (where your domain is registered
and whereever they send that information for other DNS to serve that
top level information) that associates your name servers with their
ip addresses... so in these files, you don't need to have an address
(IN A) record to declare their IP address... :

mainvirtdomain.com.  IN      SOA     ns1.hostdomain.net.
hostmaster.hostdomain.com. (
                                2001050909 ; serial
                                28800 ; refresh
                                7200 ; retry
                                604800 ; expire
                                86400 ; default_ttl
)
mainvirtdomain.com.  IN      NS      ns1.hostdomain.net.
mainvirtdomain.com.  IN      NS      ns2.hostdomain.net.
;
mainvirtdomain.com.  IN      MX      10 mail.mainvirtdomain.com.
;
mainvirtdomain.com.     IN A       xx.xx.xx.xx
www                     IN A       xx.xx.xx.xx
ftp                     IN A       xx.xx.xx.xx
mail                    IN A       xx.xx.xx.xx
dev                     IN A       xx.xx.xx.xx
www.dev                 IN A       xx.xx.xx.xx
devicf                  IN A       xx.xx.xx.xx
www.devicf              IN A       xx.xx.xx.xx
icf                     IN A       xx.xx.xx.xx
download                IN A       xx.xx.xx.xx

Every one of the xx.xx.xx.xx is the same IP number.  We stayed away
from CNAME records in DNS because, as we have read the documentation,
it seems as though the CNAME records are somewhat ambiguous in use
and are often a cause of DNS problems.

As always when making DNS changes, always change the "serial" number
to something else before restarting named.  I restart using "ndc restart"
at a root command prompt.

Then in the apache Vhosts.conf file, I've got the nearly the same
virtual host (with different ServerName, ServerAlias, DocumentRoot,
CustomLog, ScriptAlias (for /cgi-bin/) for each of the different
virtual servers listed above.....

NameVirtualHost xx.xx.xx.xx

## again xx.xx.xx.xx is the same ip address all of the way through
## the Vhosts.conf file

################# mainvirtdomain.COM
<VirtualHost xx.xx.xx.xx:80>
ServerName mainvirtdomain.com
ServerAlias mainvirtdomain.com www.mainvirtdomain.com
DocumentRoot /home/mainvirtdomain/public_html
ErrorLog /home/mainvirtdomain/logs/error_log
CustomLog /home/mainvirtdomain/logs/access_log combined
ScriptAlias /cgi-bin/ /home/mainvirtdomain/cgi-bin/
<Directory /home/mainvirtdomain/cgi-bin>
AllowOverride None
Options ExecCGI
</Directory>
</VirtualHost>

<VirtualHost xx.xx.xx.xx:80>
ServerName dev.mainvirtdomain.com
ServerAlias dev.mainvirtdomain.com www.dev.mainvirtdomain.com
DocumentRoot /home/mainvirtdomain/dev
ErrorLog /home/mainvirtdomain/logs/error_log
CustomLog /home/mainvirtdomain/logs/access_log combined
ScriptAlias /cgi-bin/ /home/mainvirtdomain/cgi-bin/
<Directory /home/mainvirtdomain/cgi-bin>
AllowOverride None
Options ExecCGI
</Directory>
</VirtualHost>

<VirtualHost xx.xx.xx.xx:80>
ServerName devicf.mainvirtdomain.com
ServerAlias devicf.mainvirtdomain.com www.devicf.mainvirtdomain.com
DocumentRoot /home/mainvirtdomain/devicf
ErrorLog /home/mainvirtdomain/logs/devicf_error_log
CustomLog /home/mainvirtdomain/logs/devicf_access_log combined
ScriptAlias /cgi-bin/ /home/mainvirtdomain/cgi-bin/
<Directory /home/mainvirtdomain/cgi-bin>
AllowOverride None
Options ExecCGI
</Directory>
</VirtualHost>

<VirtualHost xx.xx.xx.xx:80>
ServerName icf.mainvirtdomain.com
ServerAlias icf.mainvirtdomain.com
DocumentRoot /home/mainvirtdomain/icf
ErrorLog /home/mainvirtdomain/logs/icf_error_log
CustomLog /home/mainvirtdomain/logs/icf_access_log combined
ScriptAlias /cgi-bin/ /home/mainvirtdomain/cgi-bin/
<Directory /home/mainvirtdomain/cgi-bin>
AllowOverride None
Options ExecCGI
</Directory>
</VirtualHost>


<VirtualHost xx.xx.xx.xx:80>
ServerName download.mainvirtdomain.com
ServerAlias download.mainvirtdomain.com
DocumentRoot /home/mainvirtdomain/download
ErrorLog /home/mainvirtdomain/logs/download_error_log
CustomLog /home/mainvirtdomain/logs/download_access_log combined
ScriptAlias /cgi-bin/ /home/mainvirtdomain/cgi-bin/
<Directory /home/mainvirtdomain/cgi-bin>
AllowOverride None
Options ExecCGI
</Directory>
</VirtualHost>

Save the Vhosts.conf file.  And restart apache.  You can make all
the changes to you want to these apache configuration files.  Until
apache is restarted, it'll not reflect the changes.

Tyler
--
Tyler Nally        _             _ _       The Bible is a better road map than
Freelance Webber  | |_ _ _  __ _| | |_  _  anything Rand McNally makes.  Sure,
317-345-4510      |  _| ' \/ _` | | | || | Rand McNally's maps show all of the
www.technally.com  \__|_||_\__,_|_|_|\_, | roads.  Do the maps also show the
tnally technally com                 |__/  potholes.  -- Elisabeth Sarah Nally



_______________________________________________
Redhat-install-list mailing list
Redhat-install-list redhat com
https://listman.redhat.com/mailman/listinfo/redhat-install-list





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