Click here to Skip to main content
15,396,145 members
Articles / Web Development / IIS
Article
Posted 31 May 2005

Stats

341.4K views
4.1K downloads
123 bookmarked

IIsAdmin.NET: Create Multiple Web Sites Under Windows XP

,
Rate me:
Please Sign up or sign in to vote.
4.70/5 (35 votes)
16 Jun 20052 min read
Tool for creating multiple web site definitions under Windows XP.

Sample Image - IIsAdminNet.jpg

Introduction

As web developers we all know that very rarely do we only get to work on a single site at a time. Many times we find ourselves juggling between web sites. As each site becomes more complex (virtual directories, web site configuration settings, etc.), the task of switching between different sites becomes more time consuming. Now throw in the fact that you can only create a single site under Windows XP Pro, and you have frustration waiting to happen.

Initial Solution

After looking for a bit, we were able to find a solution to the problem called IIS Admin. IIS Admin allowed for multiple site definitions to be created under Windows XP (with only a single site started at a time). At first this seemed like the answer to our prayers. We can create a separate site for each project, all the configuration changes would be saved with that site, and to switch we just start a different site. However, we soon realized IIS Admin came with a few interesting “features” of its own.

Initial Solution Drawbacks

First, the program did not show up in the taskbar. This meant that if the program lost focus it could be difficult to find again with multiple windows open. Second, if you created a site and failed to start it, the next time you opened IIS it would show up as an error. These among some others, proved to become a problem of its own when it came to introducing new developers to the program.

Final Solution

After dealing with explaining the program over and over, we decided to create IIS Admin in C# (hence IIsAdmin.NET was born) and while re-creating it, correct some of the features we found less then desirable. All of the interfacing with IIS is done via the Active Directory Service Interface (ADSI). Although the IIS ADSI provides much more functionality, we decided to keep IIsAdmin.NET’s primary function to creating the web site definition and switching between the active sites. All of the site management such as virtual directory creation can be done via IIS.

Sample screenshot

We also wanted to provide the code so others could pick up where we left off. Feel free to send us any improvements you make to be incorporated into future versions. Most of all enjoy, we hope it makes the task of switching between web projects frustration free.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Authors

Mark Belles
Software Developer (Senior)
United States United States
Senior Application Developer specializing in Windows desktop and network development.

Professional Experience
- B.S. of Computer Science (Graduated 2001 - PSU)
- Senior Application Developer (8+ yrs)
- Microsoft Certified Professional

Primary Interests
- C#, C++, HTML, Javascript
- XML, ASP.NET, Web Services, SOAP, UDDI
- Socket programming and anything network related
- Reflection, Serialization, and Plugin Frameworks
- Owner-drawn controls and GDI+ goodness

Gabe Wishnie
Web Developer
United States United States
.NET Software Developer

Education
- Working towards M.S. Computer Science
- B.S. Computer Science
- B.S. Computer Information Systems
- Minor Mathematics

Professional
- Microsoft Certified Application Developer
- Microsoft Certified Professional
- C# ASP.NET Developer (4 years)

Other Interests
- Flash Remoting
- Video Encoding (Windows Media and Flash Video)
- Microsoft Content Management Server

More Programming Thoughts and Tips
- http://gabewishnie.blogspot.com

Comments and Discussions

 
GeneralNo More HTTP Support Across LAN Pin
Clinton Gallagher10-Mar-07 4:05
professionalClinton Gallagher10-Mar-07 4:05 
GeneralProblem with debug ... Please, help. Pin
gena8511-Jan-07 12:37
Membergena8511-Jan-07 12:37 
GeneralGreat tool but... Pin
DavidBSmith14-Nov-06 9:51
MemberDavidBSmith14-Nov-06 9:51 
GeneralRe: Great tool but... Pin
Ilia Broudno25-Apr-07 10:17
MemberIlia Broudno25-Apr-07 10:17 
QuestionUpdated Source Code Pin
ChrisAdams2-Nov-06 22:47
MemberChrisAdams2-Nov-06 22:47 
QuestionHow to use with Visual Studio 2005 Pin
Clinton Gallagher18-May-06 13:13
professionalClinton Gallagher18-May-06 13:13 
AnswerRe: How to use with Visual Studio 2005 Pin
Gabe Wishnie18-May-06 15:21
MemberGabe Wishnie18-May-06 15:21 
GeneralRe: How to use with Visual Studio 2005 Pin
Clinton Gallagher19-May-06 10:37
professionalClinton Gallagher19-May-06 10:37 
A Baker's Dozen Process: 13 Steps explaining exactly how to setup and configure new web sites on an XP Pro machine when using IIsAdmin.NET. Used and tested twice for good measure!

1.) Use IIsAdmin.NET (IAN) to ensure the Default Web Site is started as the Active Site.

2.) Use the Microsoft Management Console (MMC) to create a new virtual directory located as a subdirectory of the Default Web Site at c:\Inetpub\wwwroot. For example: c:\Inetpub\wwwroot\MKE1. The example virtual directory named MKE1 will be used throughout this tutorial. After creating the MKE1 virtual directory use the MMC ASP.NET tab to ensure ASP.NET version 2.0 has been selected.

3.) Use IAN to create a new site. Describe the new site as MKE1. Select the MKE1 virtual directory at c:\Inetpub\wwwroot\MKE1 as the IAN home directory.

4.) Use IAN to stop the Default Web Site and then start MKE1 as the Active Site.

5.) Start Visual Studio 2005 (VS2005)

6.) Use the VS2005 File > New Web Site menu to create a new HTTP web site located at http://localhost (path should not end with a "/" slash). When using IAN and creating a new HTTP web site do not use your NetBIOS (Computer Name) as a short-cut replacement to resolve localhost. A new Solution called "localhost" will appear in the Solution Explorer.

An entry for the localhost Solution will appear as a Recent Project in the Start Page. Enter some confirmation text such as "Hello World" into the Default.aspx file. Use VS2005 to View In Browser or load a separate instance of a browser and request http://localhost to confirm a new web site is running from http://localhost. At this point, when using a separate instance of a browser we may return to using a NetBIOS name to request a web site hosted on a machine on the LAN.

Close the VS2005 Solution and exit VS2005.

7.) Use IAN to stop the MKE1 Active Site and then start the Default Web Site.

8.) Open Windows Explorer and observe a subdirectory named "localhost" has been created at c:\Inetpub\wwwroot\locahost. Rename that localhost subdirectory as MKE1.localhost.

9.) Use Windows Explorer to open the c:\Inetpub\wwwroot\MKE1.localhost subdirectory and copy the localhost.sln and the localhost.suo files to the MKE1 virtual directory at c:\Inetpub\wwwroot\MKE1.

10.) Use Windows Explorer to open the MKE1 virtual directory and rename localhost.sln as MKE1.sln then rename localhost.suo as MKE.suo.

11.) Use IAN to stop the Default Web Site and then start the MKE1 Active Site.

12.) Start VS2005. On the Start Page observe Recent Projects lists an item named localhost as the name of a VS2005 Solution. Double-click that localhost Recent Projects entry. A dialog will open. Use the Yes button to remove the localhost entry from the Recent Projects.

13.) Use the VS2005 File > Open Project menu to open the MKE1 virtual directory at c:\Inetpub\wwwroot\MKE1. Select the MKE1.sln file and proceed.

That's it! A new web site with file assets located in a subdirectory which will run as if it were the Default Web Site on an XP Pro machine when requested as http://localhost or when requested using a NetBIOS name. This new web site can be developed using VS2005 without any problems with unneeded subdirectories in the path of the URL used to load any of the pages in the web site.

You may delete the MKE1.localhost subdirectory or leave it around for awhile in case there is some unforseen problem that may arise when using this strategy.

In any case, remember that each time we use IAN and want to create a new web site a new subdirectory named localhost must be and will be created at c:\Inetpub\wwwroot\localhost which is why we rename each newly created localhost subdirectory prefixed with the name of our development project so all directories sort as a group in the Windows Explorer.

These procedural steps have also been copied to Code Project <http: www.codeproject.com="" csharp="" iisadminnet.asp="">.
At the moment I have no way of knowing for sure that renaming the localhost.sln and the localhost.sup files will not at some point in future development and deployment of a project choke up and cause a problem. Please e-mail me if you discover any problems with this Baker's Dozen Process.

*** Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/







<%= clintonG
GeneralBeing prompted for a password Pin
pspeth16-Mar-06 7:45
Memberpspeth16-Mar-06 7:45 
GeneralRe: Being prompted for a password Pin
Gabe Wishnie18-May-06 15:27
MemberGabe Wishnie18-May-06 15:27 
JokeNice Bike Pin
v-xan5-Mar-06 2:41
professionalv-xan5-Mar-06 2:41 
QuestionHow can I retrieve the physical location of a website Pin
Luis Cabrera13-Dec-05 5:58
MemberLuis Cabrera13-Dec-05 5:58 
AnswerRe: How can I retrieve the physical location of a website Pin
Mark Belles13-Dec-05 8:39
MemberMark Belles13-Dec-05 8:39 
GeneralRe: How can I retrieve the physical location of a website Pin
Luis Cabrera13-Dec-05 9:41
MemberLuis Cabrera13-Dec-05 9:41 
AnswerRe: How can I retrieve the physical location of a website Pin
Gabe Wishnie13-Dec-05 17:09
MemberGabe Wishnie13-Dec-05 17:09 
GeneralRe: How can I retrieve the physical location of a website Pin
Luis Cabrera14-Dec-05 9:52
MemberLuis Cabrera14-Dec-05 9:52 
QuestionYour Opinion Needed - Continue With Next Version of IIsAdmin.NET? Pin
Gabe Wishnie2-Oct-05 16:52
MemberGabe Wishnie2-Oct-05 16:52 
AnswerRe: Your Opinion Needed - Continue With Next Version of IIsAdmin.NET? Pin
Oskar Austegard16-Feb-06 5:37
MemberOskar Austegard16-Feb-06 5:37 
GeneralRe: Your Opinion Needed - Continue With Next Version of IIsAdmin.NET? Pin
OutOfTouch694711-Oct-06 7:11
MemberOutOfTouch694711-Oct-06 7:11 
AnswerRe: Your Opinion Needed - Continue With Next Version of IIsAdmin.NET? Pin
Jeremy Mullinax-Hill13-Nov-06 4:42
MemberJeremy Mullinax-Hill13-Nov-06 4:42 
AnswerRe: Your Opinion Needed - Continue With Next Version of IIsAdmin.NET? Pin
webber12345615-Feb-07 7:50
Memberwebber12345615-Feb-07 7:50 
AnswerRe: Your Opinion Needed - Continue With Next Version of IIsAdmin.NET? Pin
expresso100015-Mar-07 17:31
Memberexpresso100015-Mar-07 17:31 
AnswerRe: Your Opinion Needed - Continue With Next Version of IIsAdmin.NET? Pin
Ilia Broudno25-Apr-07 10:30
MemberIlia Broudno25-Apr-07 10:30 
QuestionHow to use with VS.net? Pin
aluminumcan22-Sep-05 8:56
Memberaluminumcan22-Sep-05 8:56 
AnswerRe: How to use with VS.net? Pin
aluminumcan22-Sep-05 11:24
Memberaluminumcan22-Sep-05 11:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.