Virtual Hosts and DNS Configuration

Virtual Hosts and DNS Configuration

am 10.07.2007 16:14:01 von martin_p

Hello,


I have a simple question about subdomains.

If a domain www.domain.tld points to a apache server with the IP
123.123.123.123 and I define virtual hosts in the httpd.conf for
a subdomain www.sub.domain.tld for a different document root, e.g.
/htdocs/www.sub/ instead of /htdocs/www/

Is it enough if I set up the domain domain.tld with the apache server IP
in the records of the DNS server?

Or do I also have to configure the subdomain www.sub.domain.tld in the
DNS server records?


Regards,

Martin



--
Error: No keyboard detected, press F1 to continue

Re: Virtual Hosts and DNS Configuration

am 10.07.2007 17:05:42 von Mark Taylor

=?ISO-8859-15?Q?Martin_Pöpping?= wrote in
news:f7047e$r01$1@newsreader2.netcologne.de:

> Hello,
>
>
> I have a simple question about subdomains.
>
> If a domain www.domain.tld points to a apache server with the IP
> 123.123.123.123 and I define virtual hosts in the httpd.conf for
> a subdomain www.sub.domain.tld for a different document root, e.g.
> /htdocs/www.sub/ instead of /htdocs/www/
>
> Is it enough if I set up the domain domain.tld with the apache server
IP
> in the records of the DNS server?
>
> Or do I also have to configure the subdomain www.sub.domain.tld in the
> DNS server records?
>
>
> Regards,
>
> Martin
>
>
>

If you want http://sub.domain.tld to resolve AND
http://www.sub.domain.tld to resolve to the same IP address then you MUST
have both a DNS entry and virtual host directives defining both.

For example:


ServerName sub.domaind.tld
ServerAlias www.sub.domain.tld
DocumentRoot /htdocs/www.sub <--Don't use a trailing slash






----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Re: Virtual Hosts and DNS Configuration

am 10.07.2007 23:16:42 von Kurt Weber

Martin Pöpping wrote:

> Hello,
>
>
> I have a simple question about subdomains.
>
> If a domain www.domain.tld points to a apache server with the IP
> 123.123.123.123 and I define virtual hosts in the httpd.conf for
> a subdomain www.sub.domain.tld for a different document root, e.g.
> /htdocs/www.sub/ instead of /htdocs/www/
>
> Is it enough if I set up the domain domain.tld with the apache server IP
> in the records of the DNS server?
>
> Or do I also have to configure the subdomain www.sub.domain.tld in the
> DNS server records?

Yes, everything has to exist in DNS; otherwise, people visiting your site
won't be able to get the IP address for it. This includes third- and
fourth-level domains. EVERYTHING has to be there.
--
Kurt M. Weber