Problem
Each operating system comes with its own version of Internet Information Services (IIS). Windows Vista and Windows Server 2008 come with IIS 7.0 while Windows 7 and Windows Server 2008 R2 come with IIS 7.5, which is essentially an improved version of IIS 7.0 with more features.
IIS 7.x is in fact a complete redesign and rewrite of IIS, so the following instructions on how to deploy a CGI or web application are different from the ones for IIS 6.0 running on Windows Server 2003.
Resolution
1) Install MF Server for COBOL 5.1 and apply the WrapPack level that matches to the one used on Net Express 5.1.
Note: Net Express 5.1 and Server for COBOL 5.1 are certified on Windows 7 and Windows Server 2008 R2 starting with WrapPack 4.
2) Make sure IIS 7.x is installed with the following Role Services, which are found under Application Development:
- CGI
- ISAPI Extensions
Note: If these role services are not installed, then the ISAPI and CGI Restrictions icon will not be found in Features View of the web server Home screen in IIS Manager.
3) Check Application Pools setting:
- Open IIS Manager
- Click on the server name (the screen displayed on the right pane is the web server Home screen)
- Expand the server name in the left hand pane by clicking on " "
- Click on Application Pools in the left hand pane
- Double-click on DefaultAppPool
- Select Classic from the Managed pipeline mode drop-down
- Click on OK
- In a 64-bit environment, right-click on DefaultAppPool, click on Advanced Settings, and set Enable 32-Bit Applications to True
- After making any changes in DefaultAppPool, the default application pool must be restarted by right-clicking on DefaultAppPool and clicking on Recycle
- Make sure the DefaultAppPool's status indicates Started
4) Add CGI-BIN (or any virtual directory name where the CGI programs will be deployed to) as a new Application in Default Web Site:
- Expand Sites in the left hand pane, which is below Application Pools
- Right-click on Default Web Site
- Click on Add Application
- Enter CGI-BIN as Alias
- Click on Physical Path's browse "..." button to select the folder where you keep your EXEs
- Click OK
5) Grant certain permissions to the IUSR (local) account on CGI-BIN application:
- Expand Default Web Site in the left hand pane
- Right-click on CGI-BIN
- Click on Edit Permissions
- Click on the Security tab
- Click on Edit
- Click on Add
- Make sure the machine name is specified in the From this location field – If not, click on Locations, select the machine name, and click on OK
- Type IUSR from the Enter the object names to select field
- Click on Check Names (IUSR will be underlined as it has been checked)
- Click on OK
- Click on IUSR to edit its permissions
- Check Allowfor the following permissions:
- Read & execute
- List folder contents
- Read
- Write
- Click on OK
Note #1: By default, Anonymous authentication is enabled in IIS 7, and the IUSR account is used to allow anonymous access. This account is introduced in IIS 7.0 and replaces the IIS 6.0’s IUSR_computername account.
Note #2: If all the web (HTML) pages are kept in the same location as the CGIs, then steps 6 and 7 can be skipped.
6) Add COBOL (or any virtual directory where the HTML pages will be deployed to) as a new Virtual Directory in Default Web Site:
- Expand Sites in the left hand pane, which is below Application Pools
- Right-click on Default Web Site
- Click on Add Virtual Directory
- Enter COBOL as Alias
- Click on Physical Path's browse "..." button to select the folder where you keep your web (HTML) pages
- Click OK
7) Grant the Read permission to the IUSR (local) account on COBOL application:
- Expand Default Web Site in the left hand pane
- Right-click on COBOL
- Click on Edit Permissions
- Click on the Security tab
- Click on Edit
- Click on Add
- Make sure the machine name is specified in the From this location field – If not, click on Locations, select the machine name, and click on OK
- Type IUSR from the Enter the object names to select field
- Click on Check Names (IUSR will be underlined as it has been checked)
- Click on OK
- Click on IUSR to edit its permissions
- Check Allow for the Read permission
- Click on OK
8) Create ISAPI and CGI Restrictions:
- Go to web server home screen by clicking on the server name in the left hand pane
- Double-click on ISAPI and CGI Restrictions
- Select Restriction from the Group by drop-down
- Add a new restriction for each one of the EXEs from the folder where they reside. To add a restriction:
- Right-click in the center pane white space and select Add
- Click on the browse "..." button to select EXE file
- Check Allow extension path to execute
- Click on OK
9) Enable the Handler Mappings for ISAPI and CGI from the web server home screen:
- Go to web server home screen by clicking on the server name in the left hand pane
- Double-click on Handler Mappings (note CGI-exe and ISAPI-dll are both Disabled)
- Right-click on ISAPI-dll
- Click on Edit Feature Permissions
- Check Execute
- Click on OK (note CGI-exe and ISAPI-dll are now both Enabled)
10) Check that the ISAPI and CGI mappings are enabled for the Default Web site:
- Click on Default Web site
- Double-click on Handler Mappings
- See if CGI-exe and ISAPI-dll are both Enabled
11) Check that the ISAPI and CGI mappings are enabled for the CGI-BIN application:
- Click on the CGI-BIN application underneath Default Web Site
- Double-click on the Handler Mappings icon
- See if CGI-exe and ISAPI-dll are both Enabled