Click here to Skip to main content
15,500,741 members
Articles / Web Development / IIS
Posted 16 Mar 2005


73 bookmarked

Windows XP IIS Manager v1.7

Rate me:
Please Sign up or sign in to vote.
4.96/5 (30 votes)
16 Mar 2005CPOL5 min read
This article presentes a way of creating and managing multiple sites on the Windows XP IIS.

Image 1

Image 2


Right now, I don't have a web server (Windows xxxx server), and as you all know, building multiple web sites on Windows XP is not very simple. Even if you have a server, you will always need a way of test something on you local computer before you upload it to the production server, and this solution may be of some use.

Windows XP IIS:

Problem 1: only one site - Microsoft has provided us with the "admin scripts", so we can create more sites, but these scripts are painful to use.

Solution: So I have decided to build a tool to take that pain go away.

Problem 2: only one site running at a time - this is not really so bad, but I didn't like to have to open "Internet Information Services" every time I have to change from one site to another.

After I completed the tool, I saw that it would be my first article. Why? Because maybe some one else has been having the same problems, and because, while I was making this tool, I realize that information on "Controlling IIS with C++" is difficult to find. So, I provide a "Ready to use tool" and the sample code.

Even knowing that .NET web programming has the bad habit of wanting the "Default Web Site" as the root for development (and if someone knows a way of doing it locally with other sites, I will be happy) , I think this tool may be useful...

Here it goes ...

The EasyIIS Tool

This tool will give you a way to create, delete, and change some properties of the existent sites. I have not implemented "all" the features of the IIS snap-in because I wanted to keep it simple. I wanted to make it as simple as possible, create a site by a few clicks. For extra features, we have always the IIS snap-in!

It will also update the HOSTS file, this way you will be able to access the sites by typing something like http://yousite rather than using http://localhost. This comes in handy to prevent problems with "temporary internet files" like CSS and JS, because you may use (like me) some global CSS files that are different for each site but have the same name.

For example: http://testsite1/global.css and http://testsite2/global.css.

If you don't use the HOSTS file to access the different sites by typing http://testsite1 and http://testsite2, you will have to access the two by typing http://localhost and therefore the file global.css will have the same URL for the two sites (http://localhost/global.css) and this may create some strange problems because the "temporary internet files" will think they are the same file.

This was annoying, so I started to manage the hosts file.

Image 3

Image 4

Windows XP lets you run only one site at a time, so there is an option to stop the running site before starting the new one.

Points of Interest

The points of interest will be in the "readers eyes", but for me it was the fact that I had a hard time to get information on how to do it with VC++.

You never know when you will need to create some crazy tool to access the IIS, lets say, in some Intranet for example. Imagine you have a server full of customer sites, and that you want your "tech people" to access the IIS in order to change something. I bet you will not want them to play around with all that IIS snap-in can offer, plus they would be consuming one of the (only) two precious Terminal Services Connections, or even more...

Imagine that your commercial department wants to be able to "cut" customer services for some reason. I guess you will never give them access to the servers, but you may not be always around to go to the server and stop/start a site every time they want.

So you may want to develop some kind of IIS back-office with a few options for them to access via browser... OK OK I can ear already someone saying that they can do it with .NET and that you don't need C++ for that. True, but that's not the point here, the point is that you may be like me, in love with ISAPIs, and if that's the case, every time something like this comes around we immediately think "what if... ISAPI...".

And this is the point... to point you to some code which is able to do it, if for some reason you are having a hard time guessing it up.

Granted that this is not an ISAPI, it still is in C++ and "binding" this code with an ISAPI will not be hard.

About this project, I want to say that I always stop the running site (if that option is active) prior to starting another, this is needed only in Windows XP because only one aite can be running at a time. And to start one, I have to stop the other, or the start command will fail. But the real problem appears when you delete the running site without stopping it before! You will not be able to start another site without a IISRESET or a reboot.


It has always worked for me , but I strongly suggest that you test it before you use. I did not test "every scenario"!!


03-03-2005 v1.7 First release.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Software Developer
Portugal Portugal
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

Questionhow to enable or disable the parent path? Pin
lingdu9-Jan-12 16:18
Memberlingdu9-Jan-12 16:18 
GeneralMy vote of 5 Pin
Member 249360427-May-11 2:39
MemberMember 249360427-May-11 2:39 
GeneralHi, thanks friend, it's a great tool, but could you do more. Pin
Blue(Shanghai)23-Apr-07 22:20
MemberBlue(Shanghai)23-Apr-07 22:20 
GeneralThanks a lot !!!!!!!!!! Pin
Veeeeer13-Jan-07 4:21
MemberVeeeeer13-Jan-07 4:21 
GeneralRe: Thanks a lot !!!!!!!!!! Pin
Max Santos14-Jan-07 8:07
MemberMax Santos14-Jan-07 8:07 
Generalconvert to or Pin
horhen2-Nov-06 5:14
Memberhorhen2-Nov-06 5:14 
QuestionWhy not add a feature of " Application Protection " Pin
murphy.yang12-Sep-06 9:25
Membermurphy.yang12-Sep-06 9:25 
QuestionDefault settings for new site creation Pin
Neil Monroe4-May-06 11:21
MemberNeil Monroe4-May-06 11:21 
AnswerRe: Default settings for new site creation Pin
Max Santos6-May-06 11:04
MemberMax Santos6-May-06 11:04 
GeneralRe: Default settings for new site creation Pin
Neil Monroe17-May-06 6:41
MemberNeil Monroe17-May-06 6:41 
GeneralTerrific! Pin
paddyincr5-Jan-06 9:29
Memberpaddyincr5-Jan-06 9:29 
GeneralThank you! Pin
rico8312-Oct-05 10:33
Memberrico8312-Oct-05 10:33 
GeneralRe: Thank you! Pin
CoolVini14-Oct-06 7:14
MemberCoolVini14-Oct-06 7:14 
GeneralMinimize on system tray Pin
ivanhalen16-Sep-05 13:27
Memberivanhalen16-Sep-05 13:27 
GeneralRe: Minimize on system tray Pin
Max Santos5-Oct-05 15:48
MemberMax Santos5-Oct-05 15:48 
GeneralRe: Minimize on system tray Pin
timgaunt3-Mar-06 1:44
Membertimgaunt3-Mar-06 1:44 
GeneralRe: Minimize on system tray Pin
Max Santos3-Mar-06 13:11
MemberMax Santos3-Mar-06 13:11 
GeneralMultiple web sites in IIS 5.1 Pin
Stefan Schreier14-Sep-05 8:42
sussStefan Schreier14-Sep-05 8:42 
GeneralYou da man! Pin
onlyabill9-Sep-05 4:23
Memberonlyabill9-Sep-05 4:23 
GeneralRe: You da man! Pin
Max Santos9-Sep-05 11:51
MemberMax Santos9-Sep-05 11:51 
GeneralPerfect Tool =) Pin
Bruno Oliva24-Aug-05 8:52
MemberBruno Oliva24-Aug-05 8:52 
GeneralRe: Perfect Tool =) Pin
Max Santos24-Aug-05 11:45
MemberMax Santos24-Aug-05 11:45 
QuestionStart sites at the same time? Pin
Anonymous7-Jul-05 7:11
MemberAnonymous7-Jul-05 7:11 
AnswerRe: Start sites at the same time? Pin
Max Santos7-Jul-05 12:00
MemberMax Santos7-Jul-05 12:00 
GeneralRe: Start sites at the same time? Pin
challagulla21-Dec-05 19:08
Memberchallagulla21-Dec-05 19:08 

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.