Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


August 2000

Multiple Web Sites with IIS 5.0 and IIS 4.0

RSS
Subscribe to Windows Web Solutions | See More IIS and Web Administration Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

IIS 101

Editor’s Note: Each month, this Web-exclusive column provides resources and answers for new IIS administrators. For more information about beginning IIS administration, be sure to check out Brett Hill’s IIS Answers (http://www.IISAnswers.com).

One key feature of IIS is its ability to host multiple virtual Web sites. This article provides quick answers to questions new administrators have regarding this capability of IIS 5.0 and IIS 4.0.

Can I use the default Web site for my main site?

You can use the default Web site for your main site, but I recommend not using the default Web site as one of your Web servers. On my Web servers, I turn the default site off most of the time. I turn it on when I need to access the IIS documentation, which is installed on the default Web site during IIS installation. Create your working Web site apart from the default site, and turn off the default site when it’s not in use.

How many virtual Web sites can I have?

The answer depends on your Web site, network load, hardware, and OS requirements. Microsoft recently stated that IIS 4.0 has a "perceived" limit of 250 Web sites. Microsoft designed IIS 5.0 to support thousands of virtual Web sites on the same server. That means most businesses can rely on IIS 4.0 to support 250 "typical" sites. I know some installations with three to four times that number. However, if you want stability and reliability, I urge you not to press that far. (You won’t receive a message saying that you’ve reached your maximum number of Web sites.) The Microsoft article "Performance of Internet Information Services 5.0: The Internet Service Provider Scenario" (http://www.microsoft.com/technet/iis/technote/ispscen.asp) provides valuable information about IIS scalability.

Do I need a unique IP address for each Web site?

Using unique IP addresses is one of three ways to create virtual Web sites. The other two ways are to use Host Headers or unique TCP port numbers. (You can find a tutorial on creating Host Header-based Web sites at http://www.iisanswers.com. Also, see Marnie Hutcheson, "Using Host Headers to Set Up a Multihomed Server," October 1999, and "How to Build a Web Development Environment," November 1999.) Using TCP ports is a good method for Web sites you don’t want to make publicly accessible. By default, Web servers listen on TCP port 80. If you change ports, users won’t be able to locate the Web site by name unless they know the port number, which is a useful tactic in the case of Web sites that you want to be more secure (e.g., the built-in administrative site). If you look at the properties of the Administration Web Site, which is installed by default in IIS, you’ll notice that it has a nonstandard port number. To access that site, use http://localhost:<port number>. So, to answer the question, no—you don’t need a unique IP address, but if you have enough addresses to go around, I recommend using one.

Can I use Secure Sockets Layer (SSL) with Host Headers?

If you want to use SSL with Host Headers, unique IP addresses have an advantage. Because the HTTP request is encrypted when you use secure communications with SSL, IIS can’t decode the communication to see which Web site should receive the packet. As a result, SSL and Host Headers aren’t a good mix. This problem disappears if you use unique IP addresses because the IP addresses aren’t encrypted in an SSL exchange. If a Web hosting service is using the Host Header technique and wants to provide SSL, the provider commonly creates a Web site with a unique IP and enables SSL for it. Within that site, the provider can create virtual directories for each Host Header site. In this way, you can place documents from the non-SSL-enabled Host Header site in the SSL-enabled virtual directory and link to them from your pages. This scenario isn’t ideal because the URL changes to a different Web site whenever you want to initiate an HTTP over Secure Sockets Layer (HTTPS) session, but many ISPs use this technique to provide SSL to Web sites they host. (See the Microsoft article "IIS: HTTP 1.1 Host Headers Not Supported When Using SSL," http://support.microsoft.com/support/kb/articles/q187/5/04.asp.)

Should I use unique IP addresses to avoid a performance penalty when using Host Headers?

No significant performance penalty exists for using Host Headers.

End of Article



Reader Comments
I have browsed through numerous pages on how to set up host headers in IIS, however, no one I can find as posted an even more important topic of how you map these headers to the appropriate default document directory. It does not appear that it can be done in IIS Manager. If I am hosting 2 web sites with 2 different domains, I would certainly not want both sites to have the same main index page. In Apache this is made simple by creating two virtual host with different root directories. Can this be done in IIS? Can it be done without some side program? Why does microsoft make things so complicated when they don't have to be.

Stephen March 22, 2002


Stephen, what you would have to do in this case is set up two different sites in IIS. You can define multiple host headers for a single site, in which case the home directory would be the same for all, but if you're looking to have different sites with different host headers and different home directories, create two separate sites. That way you can designate the home directory for each site independently. Note that you need IIS on NT4 Server or W2K Server to do this; PWS or IIS on NT4 Workstation or W2K Professional only allow one site per system.

Patrick April 18, 2002


Ditto....I have to agree with Stephen, I've been browsing for a day now and have not found concrete instructions on how to achieve this, what should be, simple task. Microsoft's instructions are not clear cut. If anyone can point me in the right direction it would be helpful.....

Oneil May 10, 2002


The article is very much correct, but is there any limit to the number of host headers that can be bound to one virtual site in IIS 5.0 (Win2K server)? If so, what are the performance issues?

deepa August 04, 2002


This article is good but I couldn't find anything about the FTP sites. I want to have multiple FTP sites on one server and I'm looking in various solutions.


Marcel Michenka November 20, 2002


How do I create an unique IP address? I'm a complete newbie to this. I have tried HTTP Headers, but they don't work. I liked the tutorial, too!

Thanks,
Eddie

Eddie November 10, 2003


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
The Memory-Optimization Hoax

Don't believe the hype. At best, RAM optimizers have no effect. At worst, they seriously degrade performance. ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 24, 2008

An often irreverent look at some of the week's other news, including a Vista Capable dismissal request, Zune price reductions, Morrow musings, Novell and Microsoft sitting in a tree ... two years later, Yahoo!, IE 6 on Windows Mobile, and so much more ...


Related Events Delivering Reliable and Effective Web-Based Applications

Making Web Application Perform Better: What to Watch, How to Watch It, and How to Fix It

Check out our list of Free Email Newsletters!

IIS and Web Administration eBooks Keeping Your Business Safe from Attack: Monitoring and Managing Your Network Security

Related IIS and Web Administration Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing