5 Easy steps to install IIS 5.1 on Windows XP Professional SP3 and setup/run my CGI Program

IIS is the web server on the windows platform, similar to UNIX’s Apache server. Windows XP Professional SP3 has built in support for Internet Information Services or IIS. The built in version of IIS is 5.1.  When you install windows XP, IIS is not automatically installed and enabled. You need to go to Control Panel to “Add Remove Programs” to setup IIS 5.1. In this post, I am going to show you how to install IIS 5.1 on Windows XP Professional step by step.

Step 1: Open up Control Panel

You will see many icons and one of them is  ”Add or Remove Programs”


Click on ”Add or Remove Programs”

You will see the following “Add or Remove Programs” window


Step 2: Click on the “Add/Remove Windows Components” on the left

You will see the following window where IIS is listed as one of the options. Its in unchecked condition by default.


Click on Details button. You will see the following Window showing Internet Information Services (IIS)


Click on Details button again. You will see the following Window showing World Wide Web Service. Click OK and Viola! your IIS 5.1  server is setup and running on your windows XP professional box.


Step 3:  Create a Virtual Directory in IIS 5.1

Click on the start button on the bottom left corner of windows desktop and  choose “Run”. Type “inetmgr” and hit OK.

RUN INETMGR to see IIS Services

When you run inetmgr, you will see the IIS Services window as shown below. It will list all the web sites running on XP. Right click on the “Default Website”  and choose New Virtual Directory menu.


The Virtual Directory Creation Wizard will start up and show the following window.


Click Next and it will ask you to name the Alias for the Virtual Directory. Remember, whatever you type here is your alias and you will need to use this in your URL to access the website virtual directory once its created.


Next it will ask for you to choose the Physical directory to map to the above alias (virtual directory).


Once you choose the physical path, click next and it will show you Access Permissions window as shown below. By default Read and Write Scripts (such as ASP) are checked. Since we want to run a CGI program, will go ahead and check Execute (Such as ISAPI applications or CGI”.


Step 4:  Setup port and “Execute Permissions” for the Virtual Directory

Now I’ll right click on the Default Web Site node in the IIS manager and choose “Properties”. Go to “Web Site” Tab. By default the port 80 is assigned to the “Default Website”. We have created a Virtual directory “temp” under the default web site. All virtual directories use the same port as the parent web site. I am going to change the port to 81.


Now I’ll right click on the Virtual Directory “temp” in the IIS manager and choose “Properties”. In the following window, choose “Home Directory” tab. In this tab, you will go to Execute Permissions and choose “Scripts and Executables” so that we will be able to run CGI and ASP scripts. The default was “Scripts Only” which is enough to run ASP.NET program scripts.


Step 5: Browse the ConsoleApplication1.exe to see the output in browser

Open the windows explorer and copy the ConsoleApplication1.exe  CGI Program that we created in C# and Visual C# 2010 Express into the c:\temp folder.   Refer to earlier in my post 8 easy steps to develop and setup C# CGI program in IIS 7 to see how we actually created that exe program in C#.

Now go back to IIS manager and right click on the temp virtual directory and you will see the contents. You will see the ConsoleApplication1.exe on the right hand side. Right click on this exe and choose browse.


IIS will launch your default browser (Google Chrome in my case) and call the URL localhost:81/temp/ConsoleAppliaction1.exe. I can modify the URL a bit and append x=1&y=2 and hit enter. You will see the output of the CGI and notice that the GET parameters are properly sent to the CGI program.


This entry was posted in IIS and tagged , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.


  1. Posted December 22, 2011 at 10:05 am | Permalink

    Nice tutorial
    keep it up

  2. Raseena
    Posted September 15, 2012 at 4:34 am | Permalink

    My system is Windows XP Professional with sp3.
    I dont have Windows XP Professional CD.
    When i trying to install IIS as you prefer i have a problem in the second step.

    When i click OK on the World Wide Web window, opened a window IIS and i click OK.
    Then i click the button NEXT in the window Components Wizard Window.
    Then a window opened name Insert Disk.
    And ask to insert the Compact Disc labeled ‘Windows XP Professional CD-ROM’ and click OK.
    Also another option is:
    click OK if you want files to be copied from an alternate location,
    such as a floppy disk or a network server.
    If i click OK:
    There is a window opened name Files Needed.
    It says insert Windows XP Professional CD-ROM into the drive selected below, and then click OK.

    Will u plz tell me what would i do.

  3. Posted March 16, 2013 at 10:24 am | Permalink

    there is not any inetmgr file exists in the running this command . so I didnt got the solution. plz help me

  4. N divya
    Posted April 9, 2013 at 10:58 pm | Permalink

    hello sir i have windows xpsp3 in D:/ drive i have a folder for inetpub and the inner folder wwwroot but it doesnt have the inner root as mailroot how can i get it .It is very important to for my project please can send me the solution for it

One Trackback

  • By Installing IIS 6.0 on Windows XP Professional on April 1, 2011 at 12:29 am

    [...] 1 Minute Ago My Tutorial 5 Easy steps to install IIS 5.1 on Windows XP Professional SP3 and setup/run my CGI Program explains how to install IIS 5.1 and run a sample CGI on windows [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>