|
Home > Archive > Apache Server configuration support > July 2007 > Virtual Hosts and DNS Configuration
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Virtual Hosts and DNS Configuration
|
|
| Martin Pöpping 2007-07-10, 1:26 pm |
| 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
| |
| Mark Taylor 2007-07-10, 1:26 pm |
| =?ISO-8859-15?Q?Martin_P=F6pping?= <martin_p@despammed.com> 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:
<VirtualHost *:80>
ServerName sub.domaind.tld
ServerAlias www.sub.domain.tld
DocumentRoot /htdocs/www.sub <--Don't use a trailing slash
</VirtualHost>
----== Posted via webservertalk.com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.webservertalk.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
| |
| Kurt M. Weber 2007-07-10, 7:28 pm |
| 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
<kmw@armory.com>
|
|
|
|
|