subdomains and vhosts

subdomains and vhosts

Post by Alexander Schu » Mon, 29 Apr 2002 11:20:04



Hi.

  We're running serveral vhosts on one server with several domains on
it. The problem is that there is just "www.domain.com" registered to
one vhost and if I enter "test.domain.com" the default vhost site will
be loaded. How can I configure Apache the way that all subdomains are
threaten as if the user entered "domain.com".

Alexander

 
 
 

subdomains and vhosts

Post by Joshua Sliv » Mon, 29 Apr 2002 11:52:25



> Hi.
>   We're running serveral vhosts on one server with several domains on
> it. The problem is that there is just "www.domain.com" registered to
> one vhost and if I enter "test.domain.com" the default vhost site will
> be loaded. How can I configure Apache the way that all subdomains are
> threaten as if the user entered "domain.com".

In the vhost that has
ServerName domain.com
add
ServerAlias *.domain.com

--
Joshua Slive

Apache HTTP Server Users Mailing List: http://httpd.apache.org/userslist.html

 
 
 

subdomains and vhosts

Post by Alexander Schu » Mon, 29 Apr 2002 13:03:59



Quote:> In the vhost that has
> ServerName domain.com
> add
> ServerAlias *.domain.com

Thanks alot. It worked. :-)

Alexander

 
 
 

1. wildcard subdomains w/ name based VHOST

I am having one problem so far with the wildcards:
I use name based Virtual Host Apache server, with several domain names
per IP#.
a line like:

*.example.com.    IN      CNAME  example.com.

in my DNS is directing  *.example.com to the default page for the IP#
that domain is assigned to.  The only way I
got it working properly is if I switch the order of the VIRTUALHOST
Apache entries in httpd.conf so that the domain
name is first under the "NameVirtualHost" Which is OK, because it works,
but since I only have 12 IP#s, that only
allows me 12 domains to host wildcard subdomains.

To explain it differently, pretend I have 2 sites on (1) IP#
example.com, and domain.com
in my httpd.conf file, if example.com is listed first under the IP#,
wildcards work fine for example.com - but for
domain.com (listed second)  the URL's with subdomains (like
sub.domain.com) all direct to example.com's default
page.

here is most of the DNS entry:
; Zone file for example.com

hostmaster.myhost.com. (
        1999072501
        10800
        1800
        3600000
        1800
)
                IN      NS      mydns.myhost.com.
                IN      NS      secondarydns.myhost.com.

example.com.      IN      A      209.249.26.26
                IN      MX      10 mail.myhost.com.
*.example.com.    IN      CNAME  www
mail            IN      CNAME  venus.myhost.com.
www            IN      CNAME  example.com.
ftp            IN      CNAME  example.com.
pop3            IN      CNAME  example.com.

How can I fix this so any VHOST can support wildcard subdomains w/o
resolving to the deafult page for the shared
IP#?

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

2. how do i remove a file with a ~ in it ????

3. vhosts and subdomain for user

4. RedHat-6.1 and ethernet

5. ServerName without any subdomain listed matches all subdomains

6. 'optional' line in lilo.conf?

7. Mixing name-based vhosting with mass-vhosting

8. exec hangs from .bash_profile

9. Matrox Mystique ands X.

10. !!!NIS+ Subdomain Questions, Please Help!!!

11. HOW TO: multi-server free subdomain hosting?

12. DNS and Subdomain Delegation

13. Local Subdomains