|
Hosting multiple sites on IIS with Host Headers
An
easy way to host multiple websites on your IIS webserver
As
usual, first things first. If youre running NT4 Workstation, Windows 9x,
Windows 2000 Pro or Windows XP Pro, this article isn't for you. the
Operating systems listed are not capable of hosting more than one virtual
server at a time. For this you need a Server Operating System.
Down
to business then. You have a server, you want to host an additional domain
on it. You want to know how to go about this. It's actually fairly simple.
There are two stages involved.www.tartoos.com
Stage 1 : DNS
First
of all, your chosen domain name will need to be set up in your DNS system.
If you're unsure who does your DNS hosting, contact either your usual IT
contact, or your ISP directly. Discussion of configuring a new DNS entry is
beyond the scope of this article, and besides, there are many different DNS
servers available, each with a slightly different way of setting this up.
Generally, you can leave this to the DNS administrator. get him/her to add a
new entry for your chosen domain name and point it at your webserver's IP
address. For example, laptop.atrax.co.uk : 210.10.49.82 (IP address not
valid). If you're the DNS administrator, I'd expect you to know this, and
since it's not an IIS issue, I'm skirting over it!
Stage 2 : IIS host headerswww.tartoos.com
IIS
can distinguish between two sites on the same IP address by using Host
Headers - that is, by checking what domain name the request is aimed at
before deciding which site to serve the request with. HTTP headers contain
this information, and IIS can use it.
First
step is of course to create your new site. Start by opening Internet
Services Manager and right clicking the root node (your computer name, or
the remote computer you're connected to). You'll find a 'New' option - then
click 'Web Site'. You'll be presented with a wizard. Start by adding the
descriptive name of your new site (I often use the domain name for this),
then click 'next'.www.tartoos.com

Here
you'll be presented with a new option screen. In IIS4.0 you have the option
of setting IP address and port number. in this case, leave them on 'all
unassigned' and '80' unless you have multiple IP addresses and wish to use a
particular one. in IIS5.0 and 5.1 you're also presented with the option to
add a single host header at this stage. I generally leave this blank even if
I intend adding host headers later, but that's just my preference. I usually
add a domain.com header and a www.domain.com header, so this makes sense.www.tartoos.com
Finish up the wizard and you'll be back in ISM/MMC with your new site
displayed in the listing. If you're in IIS4.0 or opted not to create headers
at this stage in IIS5.0, your site will be in the 'stopped' state. Leave it
as it is for now, right click the node and select 'properties'
The
first screen you'll be presented with is shown below

No
need to explore the tabs at this stage, just hit the 'advanced' button next
to the IP address dropdown. You'll be presented with another new screen.

You'll see that there's already a 'header' set up - a blank one. If you
wish, you can edit this header, or simply add new ones - it should be pretty
obvious how it's done!

You
get presented with the screen above, simply fill in the domain name you
require IIS to react to (no HTTP:// at the beginning, just the domain!), and
hit he OK key. You'll be presented with something that looks like this

You
should now be able to start and test your new site (providing the DNS
records are fully updated) by simply calling it up in your browser.
Et Voila -
multiple domains hosted on IIS with minimum fuss.
Why Windows XP Home Doesn't Support IIS
There's been a
lot of whingeing recently in Microsoft newsgroups and on ASP messageboards
all over the web. It seems to be coming from folks who've bought Windows XP
Home edition and have discovered that it does not include IIS. In fact, IIS
won't even install on XP Home. They seem to think they've been cheated out
of something. I disagree. SOme people won't like what I have to say in this
article, but I'm sure I can live with that.www.tartoos.com
It's no
surprise, and should be no surprise, that XP Home has a lack of IIS support
- IIS (in the form of PWS) was unsupported under Windows ME, too, and XP
Home is basically the direct replacement for ME. It's not a new development.
You shouldn't be surprised.
Let's talk
about what constitutes a 'Home' user anyway. The average home user wants a
PC for a few things. Word Processing. Printing out school reports. Surfing
the web. Downloading pr0n and MP3s. Perhaps they want to connect a digital
camera and save their pictures. Maybe they want to play games.
XP Home edition
is great for these things. Absolutely brilliant.
What they don't
need is a full-featured, integrated webserver such as IIS. That's for
programmers. Programmers, generally, are more likely to stump up for a
Professional edition OS, or have one provided for them. And when I say
programmers, I'm not talking about HTML authors - HTML authors don't even
NEED a web server on their local machine, and if they do they can use any
basic HTTP daemon - IIS is an application server - HTML authors wouldn't use
90% of its features.
But I'm
not a programmer, they say. I'm a home user who's interested in programming.
So why did you buy an OS that you're interested in growing out of? I'm an
enthusiast, they say. When was the last time you met a real enthusiast who
skimped on his equipment? Someone who's a Mountain Bike enthusiast isn't
going to go out and grab a $150 clunker from a mail order catalogue -
they're going to make an informed decision on the sort of bike they want and
deserve. They make an informed choice. But I've only just decided I wanted
to learn, they say. So what if you decided you wanted to learn
photoshop? You'd probably have to stump up for a
full version of the software - note the term full version. XP Home is
cut down for Home users, it's not even there for learning programming,
though you can still use WSH, VB, Java, whatever.
But it came
pre-installed with my PC, they say. So? Take it up with the vendor - they're
likely to be able to provide you with a very competitive upgrade deal.www.tartoos.com
IIS, let's face
it, isn't required for a home user. During the Code Red and Nimda epidemics,
may ISPs BLOCKED port 80 on their networks because of poorly configured IIS
servers on home connections becoming infected. IIS isn't a toy. It's
potentially dangerous in the wrong hands - such as Home users assuming they
need it and installing the services, leaving them unpatched and open to
exploitation. IIS includes an SMTP server which can potentially be exploited
by spammers, an FTP server that can be exploited by Warez kiddies and a web
server which is so richly featured and OS-integrated that it can be a
daunting task to keep it safely patched. Home machines are too hotch-potch
to be a secure place for a webserver.
But, they say,
if the default configuration was more secure, we'd be OK. We could have
'our' IIS back. not so. Let's say, at minimum, MS left out a few script
mappings. It'd take longer to restore the ones we may need than to remove
the ones we don't. Let's say that authentication was enabled tightly by
default. We'd have a flood of new users asking how the hell they get to view
their webpages, or get to their FTP server. Nope, It's better as it is, at
least in the hands of a knowledgable user. IIS is business focussed now.
It's aimed at professionals. It's designed for them.
But it's for my
business, they say. I run my business from home and I need IIS to develop my
website. XP Home is not intended or recommended for business use, and in
fact I wouldn't be surprised if it's not even licenced for business use.
Check your licence agreement, please.
"Can't I use
work-rounds?" they ask. "Surely we can shoehorn IIS in". You can try.
Firstly, you'll be breaching your licence agreement, and possible someone
else's since you'll have to borrow an XP Pro CD to get the files from.
That's your tech support gone. Secondly, IIS is so tightly bound to the
Windows subsystem that there are some features that simply don't exist in
the home edition that you'll probably also have to find and shoehorn in.
There have been some work-rounds published, but from what feedback I've seen
through involvement with IIS newsgroups, they're really a lot more hassle
than just upgrading the OS - with fewer benefits.www.tartoos.com
PWS no longer
exists. PWS was the home user's IIS. Extrapolate from this, then, that there
is no longer an IIS for home users. Really, if you want to run IIS, you
should be running XP Pro, or Windows 2000 Pro (or better), or even NT4. I
will concede that perhaps there may be cases where an OS has been provided
on assumption (vendor misinformation? perhaps), but I think generally it's
more a question of an assumption on the part of the customers for these
machines. It's no good to assume. You wouldn't do it when buying, say, a
refrigerator, a television or a DVD player ("I assume this DVD player has a
SCART-compatible output?", "Well, sir, now that you mention it....") - but
folks do it when spending a lot of money on a new computer? Seems they do.
Bite the
bullet. Upgrade to Pro. Or if you 'upgraded' from Windows 2000 to XP home,
go back!www.tartoos.com
And by the way -
you should be aware that Apache webserver *will* install on XP Home -
since it doesn't rely so heavily on the Win32 subsystem and isn't part of
Microsoft's business focus. Perhaps you could try that if you're so angry
with Microsoft?
|