Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

IIS Script Configuration

How do I get my CGI script to work under IIS: by missbarbell
Posted: 9 May 03

The following is by no means complete, but will hopefully help you figure out where you might be going wrong.

In the Internet Services Manager (under the Administrative Tools of your Control Panel), right click either on the Default Web Site or your Virtual Directory and select 'Properties'. This should then popup a box of configuration settings. Select the 'Home Directory' tab. Towards the bottom is a drop-down list of 'Execute Permissions', at the very least this should be set to 'Scripts only'. Next to this drop-down list is a 'Configuration' button, click it. This will open an Applications Configuration popup, with a list of 'App Mappings'.

These 'App Mappings' tell IIS which extensions map to which applications. For example the .asp extension should map to a asp.dll. In order to get you CGI scripts to run in IIS, you will need to map the extension of your script to the correct application. In this example I will assume that .cgi and .pl are Perl scripts, but the principle applies to any other CGI scripting language & extension.

On the 'App Mappings' tab, click the button that says 'Add'. This will bring up a blank input popup. The format for the 'Executable:' text box is "<path to app> %s", which for ActivePerl would usually be "C:\Perl\bin\perl.exe %s". The '%s' indicates that the script file needs to be added to the command string. This last bit is probably the most important bit, as I recently spent half a day trying to figure out why scripts wouldn't work only to discover this little gem.

Next add your extension. If you need both .cgi and .pl, you will need to add them separately from the Configuration popup. For this example we'll just add '.pl' into the 'Extension:' text box. The other inputs can be left as is, although it is worth checking the box for 'Check that file exists', just in case something gets deleted or moved. Finally click 'Ok'. On returning to the Applications Configuration popup, you should see a newly added entry to the list. Now either click 'Apply' or 'Ok' to apply the changes.

You will need to stop and start the Web Server in order to action these changes, but once reactivated you should be able to run your CGI scripts :)

Back to Microsoft: Windows servers FAQ Index
Back to Microsoft: Windows servers Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close