Problem: CGI programs are installed but not responding on Windows using IIS
This article applies to all CGI applications.
Last Updated: 11 June 2015
The CGI program is installed on a Windows web site, but the CGI application doesn't appear
to be responding even though IIS is running. The browser may offer to download the
CGI program file instead of executing it.
CGI applications require that CGI scripting be properly enabled on the web server. Versions of IIS starting with 6.0 on Windows Server 2003 have new
restrictions on applications that require additional configuration steps to enable CGI programs. By default, any
new CGI program must have an Application Extension Mapping defined for its executable in the website properties,
AND it must be added to the Web Service Extension Restriction List (WSERL) before it will be executed by IIS.
- Use Server Manager's "Add Role Services" option to add the CGI role service to the Web Server role.
- Create a separate folder for your CGI programs in your website's main file folder (i.e. C:\inetpub\wwwroot\cgi-bin\).
- Copy your CGI application and any supporting files into the new cgi-bin folder.
- Use IIS Manager to view the folder list in your website. Right-click the new cgi-bin folder you created and choose "Convert to Application" and accept the default settings.
- Modify security on the filesystem to grant the IUSR user "Modify" permissions to both the cgi-bin folder and the system TEMP folder (i.e. C:\Windows\Temp). If you don't know the location of the system TEMP folder, check your system's environment variables.
- Back in IIS Manager, highlight the Server machine name in the left-hand column (note this is a number of levels up from the website item) and choose the "ISAPI and CGI Restrictions" icon.
Click the "Add..." link to define a new extension, entering the full path to the CGI Program and a friendly name for the extension, i.e.
ISAPI or CGI path: C:\Inetpub\cgi-bin\dompass.exe
Don't forget to click the "Allow" link to enable the extension.
Description: Domain Password
- Next, with the "cgi-bin" folder highlighted in the left-hand pane, click the "Handler Mappings" icon and then the "Add Module Mapping" link to add a new mapping with these values:
Request path: dompass.exe
Name: Domain Password