Updated: August 10, 2001
For Windows 2000 Server/Advanced
Server (does not work in Windows 2000 Professional)
In this section, we'll go
through how to run a subdomain on IP number using Host Headers. Host Headers
is typically used to run multiple domain names on 1 IP address, but in
this special case, we'll be using it to run a subdomain for a domain name
on 1 IP address.
Before you configure IIS
5.0 to run a subdomain with Host Headers, you must have previously made
the proper subdomain DNS changes with your DNS nameservers. Without
those DNS changes and IIS 5.0 subdomain configuration, your subdomain
will not work correctly.
Here's how to setup a subdomain
in your DNS:
For each subdomain you want
for your domain name, you must repeat this entire process.
Let's first get to the Internet
Services Manager where we can control the setup of our webserver.
Start -> Settings -> Control
Panel -> Administrative Tools -> Internet Services Manager
My server computer is cleverly
named "Server" which is why all the screen shots have "*server" on them.
If you call your server "doofus", then you'll see "*doofus".
To add a new subdomain, we
first right click on your server name -> New -> Web Site. Note: each
subdomain
is setup as a new website in IIS 5.0. This may seem strange,
but that's how Microsoft decided to make it.
Now we have the handy wizards
to help us out.
Click "Next"
Enter a description of your
subdomain, just for your own personal use. Make it descriptive so you don't
forget what it is. Click "Next"
Here you will get to choose
the IP number that your subdomain is supposed to respond to. If you want
to subdomain to go to a different address, select that address in the first
box. However, most of us are going to want the subdomain to go to
the same IP address. This is the default screen that you see but
we cannot leave it this way.
Attention:
"All Unassigned" works for most setups, but it does not work for subdomains.
You must pick an IP address in the first box for your subdomain to function.
If you leave it at "All Unassigned" your subdomain will not work.
First
Box:
Like I just said, pick an
IP number, do not leave the setting as "All Unassigned".
Second
Box:
Next choose the port number
the website should use. Almost all web requests use port 80 and unless
you have a very specific reason for changing the port number, leave it
at 80.
Third
Box:
Here is the Host Header
box. Enter the full name of the subdomain and the domain name (subdomain.domain.com).
If you just put the subdomain without the domain name, the server will
not know where to send the subdomain requests. In this example, it's
"forums.dslwebserver.com"
Click "Next" to move to the
next step.
This screen assigns which
directory on your hard drive the subdomain is supposed to point to. This
can be any directory you want. I chose a directory under the domain
name directory. This is simply easier for me to remember, you don't
have to follow this example.
If you want the subdomain
to point to a certain file and not a directory, don't worry, we'll have
a chance to set this up further on.
The check box allows you
to choose to have anonymous access to your website which is what most of
us want, so we leave it checked here.
Here are the permission you
give visitors to your site. Here the permissions include every part of
your website. But if you only want certain parts to have certain permissions,
you can choose to do that later. For example, if you have CGI scripts on
your server, you can set it up so only the CGI directory has the "Execute"
permission needed to run CGI scripts.
Click "Next" and we are done
setting up the web service part.
Assuming your DNS settings
are correct, your website will now respond to your subdomain.domain.com.
We're almost done.
We can specify for the subdomain
to point to a directory or to a certain file. If you want to just
point to a directory, you can stop here. You might want to do this
if you are using a subdomain as a personal web space for somebody like
"jack.dslwebserver.com" and "jill.dslwebserver.com". Each subdomain
would simply point to the empty directory that Jack and Jill can configure
themselves. Another reason you might want to point the subdomain
to a directory and not a file is if the directory already has a default
document in place.
If you want the subdomain
to point to a certain file, continue with me. In my example, I want
the subdomain to point to the specific starting file of my forums.
In Internet Information Services
select the name of the domain. Right click on the domain name, then select
"Properties".
Click on "Home Directory".
You can see that the subdomain is currently pointing to a directory.
We're gonna change this so
the subdomain will point at a file. First choose the 3rd radio button
"A redirection to a URL". Next enter the name of the file with the
complete http:// path name. Do not enter the
local path of the file (C:\Inetpub\...), it must be a URL starting with
http://. Next, check the box labeled "The exact URL entered
above". This box MUST be checked otherwise the serer will send you
to the directory of the URL you enter, not the exact file you entered.
Click "Apply" or "OK" and you're done!
Now you have a subdomain
on your domain name on 1 IP address!
|