Click to See Complete Forum and Search --> : Subdomains in Apache


gutlass
08-26-2002, 04:45 PM
Ok, I've been trying to setup some virtual hosts for my domain.
Let's say I want to have:

I already have the following Virtual Hosts setup:

www.domain1.ca -> /var/www/htdocs/domain1/
www.domain2.ca -> /var/www/htdocs/domain2/

etc...

but how do I setup something like:

www.domain1.ca -> /var/www/htdocs/domain1/joe/

joe.domain1.ca?

We our hosting the boxes internally. Do I have to tell our Provider to setup come CNAMES or something like that to get this to work?

jstarkey
08-26-2002, 06:49 PM
Might be best to check out this link, first:



http://httpd.apache.org/docs/vhosts/index.html



It provides just about everything you need to get started, include common examples.

frigidman
08-27-2002, 05:33 PM
joe.domain1.ca?
We are hosting the boxes internally. Do I have to tell our Provider to setup come CNAMES or something like that to get this to work?

Yes. The zone record needs the subdomain added and pointing to your webserver. If you get tired of asking for sub domains of a particular domain, ask them to make a wildcard doamin of *.domain1.ca.

That is, if the zone file handler for your domains supports that *heh*. Depends on the software they use. I know for sure BIND9 supports it correctly, and so does DJBDNS. I've no experience with any others, and I would be skeptical of any windows-based dns server software, hehe *chuckle*.

Then on apache's side, just read up on that link posted by jstarkey. Its really a simple thing, as a subdomain website is basically another virtualhost directive (not something under another virtualhost).

yelvington
08-27-2002, 10:19 PM
And if your provider can't handle it, get one that can. I host my own site, and outsource the DNS. I use EasyDNS, which gives me a Web-based form for managing all my DNS entries.

frigidman
08-28-2002, 12:35 PM
Another free (up to so many limit) DNS web based host is "zoneedit.com". Fairly good, simple, free for a few domains etc. (although a friend had like 9 domains under it and they never charged him).

gutlass
08-28-2002, 01:42 PM
thanks for the info. I figured that the zone record needed to be updated to be able to have subdomains.

Too bad my provider doesn't seem to think that you can use wildcards in the zone file. :mad:

Looks like we are going to be switching providers. ;)

frigidman
08-28-2002, 02:09 PM
Good idea :D

Claiming that DNS records cannot have wildcards is like claiming you don't know what you are doing and SHOULDN'T be a provider to begin with :D