Abbas
Posts: 15
Joined: Fri Dec 06, 2013 6:21 am

IIS: How to add a Module Mapping under the Default Web Site?

Hi Team,

I am trying to make an installer for a website, which configures the website on the IIS. In order for my website to run on the IIS, I need to enable permissions for the cgi scripts to run. Here is what needs to be done manually on the IIS:

1. In the middle pane, double-click the Handler Mappings icon. A list of Handler Mappings is displayed.
2. In the right pane, click Add Module Mapping. The Add Module Mapping window is displayed.
3. In the Add Module Mapping window:
a) In the Request path box, enter *.cgi
b) In the Module box, enter CgiModule
c) Ensure that the Executable box is empty.
d) Click OK.

Now, I want all these steps to be taken care of by my installer; I thought I might be able to do that in the 'Application Mappings' section under the IIS section in the Advanced Installer. But the problem was there is no configuration option shown for the Default Web Site because once you click on the Default Web Site it shows Advanced Installer User Guide. Then, just for the sake of testing, I created another Web Site which allowed me to define new application mappings. But it required me to select an executable as the script processor; whereas I wanted to add a Module Mapping which maps cgi files to CgiModule, a known IIS module.

Having the context set, here are my question:
1- Is it possible to add a Module Mapping in the Application Mapping section? If not, how can I do this?
2- Why is "Advanced Installer User Guide" the only thing that I get in the main pane for the Default Web Site instead of setting options (refer to the attached screenshot)?

Regards,
Abbas
Attachments
IIS.png
IIS.png (80.24 KiB) Viewed 12703 times
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: IIS: How to add a Module Mapping under the Default Web S

Hi,
1- Is it possible to add a Module Mapping in the Application Mapping section? If not, how can I do this?
In order to achieve this you can follow the steps below (you can also refer to the attached image):
- create a new Web Site
- go to "Custom Properties" section
- use the [New] button and create a new "Collection Item"
- in the new dialog select "system.webServer -> handlers" for the "Section" field
- write "collection" (without quotes "") in the "Name" field
- from the "Collection Item" section check the "modules", "name" and "path" checkboxes
- double-click on the selected rows under the "Value" column and write the following values:
  • modules: CgiModule
    name: cgiHandler
    (you can write any name here)
    path: *.cgi
- click [OK], then build and run the project
2- Why is "Advanced Installer User Guide" the only thing that I get in the main pane for the Default Web Site instead of setting options (refer to the attached screenshot)?
We did not add support for modifying the "Default Web Site" especially because during the uninstallation of the application we remove any modification done to an web site, but if in the meantime the user did some modifications manually, then all those configuration would be lost.

Also, if some settings are made for the "Default Web Site", all those settings will be applied to all the application that exists under that website, but some applications may not supports all those settings and it would result in malfunctioning.

You can choose one of the following solutions for your scenario:
1. create a new website and configure it to fulfill all your needs
2. create a new application under the "Default Web Site" and configure it as you please
3. overwrite the "Default Web Site" with one website create and configured by you, but this is not recommended. To achieve this, you can create a new website and use for its name a property that has the "Default Web Site" value.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Attachments
IIS Custom Properties.png
IIS Custom Properties.png (34.89 KiB) Viewed 12689 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Abbas
Posts: 15
Joined: Fri Dec 06, 2013 6:21 am

Re: IIS: How to add a Module Mapping under the Default Web S

Thank you for your response.

I created a new web site and added a new collection item as advised, and I think I'm nearly there. The only problem is that I got the following error message when I run the installer:
There was an error during the IIS configuration process. Your original IIS configuration will be restored.

I have attached the installation log file to this post.
Attachments
MSI7009.zip
(77.47 KiB) Downloaded 935 times
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: IIS: How to add a Module Mapping under the Default Web S

Hi Abbas,

I'm not sure why you are encountering this problem. In order to get more details about what happens can you please download the attached debug DLL, replace the original one from the install folder of Advanced Installer 10.8 (e.g. C:\Program Files (x86)\Caphyon\Advanced Installer 10.8\custact\x86) on your machine and rebuild the package?

Just replace the original iis.dll from the install folder of Advanced Installer with this one, then restart the application and rebuild the package. This DLL should create a debug log (at install time) on the root of the OS partition (e.g. C:\AI_IIS.log), which can give us more details about the problem. So, can you send us the "AI_IIS.log" file, to support at advancedinstaller dot com, after you will build and test your installation package using the debug "iis.dll" file?

Best regards,
Eusebiu
Attachments
iis 10.8 DLL debug.zip
(1001.29 KiB) Downloaded 637 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: IIS: How to add a Module Mapping under the Default Web S

Hi Abbas,

It seems that the problem is caused by the fact that the "verb" attribute is not specified (in the "IIS Collection Item" dialog). Can you try to specify the verbs you need (i.e. VERB1,VERB2 to specify the verbs you need or * for all verbs) and see if it works?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Abbas
Posts: 15
Joined: Fri Dec 06, 2013 6:21 am

Re: IIS: How to add a Module Mapping under the Default Web S

Hi Eusebiu,

Thanks for your help. I managed to get the handler mapped by setting the following values:
modules: CgiModule
name: cgiHandler
path: *.cgi
requireAccess: Script
resourceType: File
verb: *

The only problem now is the order of the Handler Mappings. When I add a Handler Mapping manually, it goes to the top of the list, which is what I want in this case. But the installer adds the Handler Mapping to the end of the list, which means the incoming requests will be served by other Mappings (Static File in this case) before they get to cgiHandler. Is there any way that I can get the installer to set the order of the Handler Mapping?

Regards,
Abbas
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: IIS: How to add a Module Mapping under the Default Web S

Hi Abbas,

Indeed, this seems to be an Advanced Installer issue. We have already fixed this and it will be available in the next version of Advanced Installer. Thank you for bringing it to our attention.

If you need to test it, you can send us an e-mail to support at advancedinstaller dot com and we will give you the fixed DLL file.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: IIS: How to add a Module Mapping under the Default Web S

Hello,

The Support for IIS 7+ Module Mapping has been added in version 11.0 of Advanced Installer released on March 13th, 2014.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”