You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Darrel Austin <da...@visi.com> on 2002/01/16 06:32:12 UTC

Virtual Hosts vs. Aliases vs. Sub domains

I'm stuck again. I have a domain name pointing to a server. On that 
server, I want a subdomain under that domain name to point at a 
different directory as such:


NameVirtualHost 10.0.0.14

<VirtualHost 10.0.0.14>
DocumentRoot /var/www/domain/html
ServerName www.domain.com
ServerAlias domain.com *.domain.com
</VirtualHost>

<VirtualHost 10.0.0.14>
DocumentRoot /var/www/subdomain/html
ServerName subdomain.domain.com
</VirtualHost>

This *looks* like the given sample in the Apache documentation, but 
it doesn't work when I type in subdomain.domain.com (Server not found 
error). I do have other virtual hosts running just fine that are 
other domains, if that makes a difference...

-Darrel

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual Hosts vs. Aliases vs. Sub domains

Posted by Darrel Austin <da...@visi.com>.
> If you get this error, it's nothing to do with apache. It looks like
> "subdomain.domain.com" is not defined in DNS.

Woke up this morning with a clear head and made that same conclusion.

Thanks, Owen 

-Darrel (signing off a bit red-faced...)



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual Hosts vs. Aliases vs. Sub domains

Posted by Owen Boyle <ob...@bourse.ch>.
Darrel Austin wrote:
> 
> I'm stuck again. I have a domain name pointing to a server. On that
> server, I want a subdomain under that domain name to point at a
> different directory as such:

See below for a couple of points...

> 
> NameVirtualHost 10.0.0.14
> 
> <VirtualHost 10.0.0.14>
> DocumentRoot /var/www/domain/html
> ServerName www.domain.com

> ServerAlias domain.com *.domain.com
Not sure about this - I always use FQDNs here (not wildcards) but, if
the wildcard works, this will make this VH trip on
"subdomain.domain.com"... Which is not what you want. I'd remove this
line for a start.

> </VirtualHost>
> 
> <VirtualHost 10.0.0.14>
> DocumentRoot /var/www/subdomain/html
> ServerName subdomain.domain.com
> </VirtualHost>
> 
> This *looks* like the given sample in the Apache documentation, but
> it doesn't work when I type in subdomain.domain.com (Server not found
> error). 

If you get this error, it's nothing to do with apache. It looks like
"subdomain.domain.com" is not defined in DNS. You can verify by looking
in the TransferLog file when you try the hit - if you don't see anything
(even an error) then you're not getting through to apache. Check this
first...

Rgds,

Owen Boyle.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual Hosts vs. Aliases vs. Sub domains

Posted by Herb Stein <he...@herbstein.com>.
----- Original Message -----
From: "Darrel Austin" <da...@visi.com>
To: <us...@httpd.apache.org>
Sent: Tuesday, January 15, 2002 11:32 PM
Subject: Virtual Hosts vs. Aliases vs. Sub domains


> I'm stuck again. I have a domain name pointing to a server. On that
> server, I want a subdomain under that domain name to point at a
> different directory as such:
>
>
> NameVirtualHost 10.0.0.14
>
> <VirtualHost 10.0.0.14>
> DocumentRoot /var/www/domain/html
> ServerName www.domain.com
> ServerAlias domain.com *.domain.com
> </VirtualHost>
>
> <VirtualHost 10.0.0.14>
> DocumentRoot /var/www/subdomain/html
> ServerName subdomain.domain.com
> </VirtualHost>
>
> This *looks* like the given sample in the Apache documentation, but
> it doesn't work when I type in subdomain.domain.com (Server not
found
> error). I do have other virtual hosts running just fine that are
> other domains, if that makes a difference...

Permissions?

> -Darrel
>
> --------------------------------------------------------------------
-
> The official User-To-User support forum of the Apache HTTP Server
Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
--
Herb Stein
The Herb Stein Group
www.herbstein.com
herb@herbstein.com
314 952-4601



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org