How to hide the OECGI2.exe from a URL when making a request to an IIS web server (Web)
Created at 02 OCT 2009 02:05PM
Objective:
Create a URL to an IIS web server that does not contain the OECGI2 executable.
Approach:
Configure IIS so the extension .cgi will call OECGI2.
Create a program called RUN_MYCGI_REQUEST.
Configure OECGI2 to call that program.
Steps:
1. Set up OECGI2 normally so that IIS can execute http://myserver/mydir/oecgi2.exe/trace.
In this example OpenInsight is located on the F: drive in F:\NIB\OpenInsight.
Fig.1 - The web site is located in the OpenInsight html directory.
2. Configure IIS to use CGI scripts by setting Execute permissions to Scripts and Executables
Fig. 2 - The Home Directory tab.
3. Add a new CGI type:
Click the Configuration button on the Home Directory tab.
Click the 'Add' button to bring up the window.
Fig. 3 - The Application Configuration window.
Set the 'Executable' field to point to OECGI2.exe.
Set the extension to be the extension you want to use.
Click the script Engine checkbox.
Unclick the verify that file exists checkbox.
These settings instruct IIS to pass requests ending in .cgi through to OECGI2.exe.
Clearing the 'Verify that file exists' checkbox means IIS will not look for a physical file named trace.cgi. IIS will simply pass the request to OECGI2.
Fig. 4 - The Add/Edit Application Extension Mapping window.
Note:
You can have just OECGI2 on the web server configured to call the OEngineServer on a different server.
You do not need to use .cgi as the extension. ".osp" or ".run" or any other extension is OK. If you want to take over .asp or another standard extension, you just need to edit the mapping to point to OECGI2. By doing this you can have URL's like myserver/trace.asp.
4. Enabling web services extensions on Windows 2003.
Windows 2003 Server's default security settings prevent "cgi"extensions from running. In this step we will enable the .cgi extension to execute.
Click on the Web Service Extensions tab.
Click on .cgi to allow it. If you utilized a different extension, add it, then allow it.
Fig.5 - Internet Information Services (IIS) Manager
Double click on the .cgi extension to bring up a list of required files.
Add OECGI2.exe to the list.
Fig. 6 - Web Service Extension Properties window.
Restart the web server to finish IIS configuration.
5. Configuring OpenInsight
At this point if you try to run Inet_Trace you will get an error. The following examples have the OEngineServer listening on port 8081.
Fig. 7 - Issuing the request.
The problem is that IIS is passing in a slightly different URL, including the .cgi extension. We will now change OpenInsight to use a pre-processor to call RUN_OECGI_REQUEST.
6. Creating a stored procedure called RUN_MYCGI_REQUEST
Fig.8 - Stored Procedure RUN_MYCGI_REQUEST
7. Set the Registry to use RUN_MYCGI_REQUEST
Fig.9 - Modifying the OECGI2 registry settings
8. Testing the configuration
Fig.10 - Issuing the request