Lance's TextBox

About Me       - Also see my RSS simple services site.

  Home  |   Contact  |   Syndication    |   Login
  510 Posts | 7 Stories | 379 Comments | 258 Trackbacks

News

Lance Robinson is a product manager and software developer in Durham, Chapel Hill, Raleigh, and surrounding areas. More about Lance.

 Subscribe Add to Technorati Favorites

 

 

 

 


 

 

Search My Blog:

 

 

Twitter












Tag Cloud


Archives

Post Categories

Blogs

Miscellanous

Noteworthy Stuff

Popular Posts

While trying out the /n software IP*Works! 3-D Secure MPI C++ Edition (for implementing Verified By Visa, MasterCard SecureCode, or JCB J/Secure) I needed to figure out how to run a CGI application in IIS7.  I had a compiled c++ exe (3dsecure.exe) that would handle my 3d secure authentication, but what was the next step?  Here's how to do it:

First, go to the Internet Information Services (IIS) Manager snap-in.  Click on the server in the Connections list, and then click on "ISAPI and CGI Restrictions" under the IIS features view.  Here you'll want to specify the path to a specific cgi application that you want to allow.  Optionally, here you could also allow any cgi app to run, but that's not recommended.

Next, go back to the server (or a specific website) and click on Handler Mappings.  You may already have a "CGI-exe" handler (for *.exe) that is disabled by default.  Enable this, or add a new one (Request path = *.exe, Module = CgiModule, Name = whatever you like).  In the handler permissions you'll need to have "Execute" checked.

posted on Thursday, December 13, 2007 1:58 PM

Feedback

# re: How to run CGI applications on IIS7 1/20/2008 9:30 PM Matt
Just thought I'd let you know that you just ended about 6 hours of frustration on my part. What a huge pain in the ass. Of course, now the exe is unable to write to a log file on my machine, but hopefully I'm 1 step closer.

Thanks for cataloging this.

# re: How to run CGI applications on IIS7 7/14/2008 7:29 PM David

We also just wrote a tutorial about geting CGI's to work with IIS7 (and previous IIS releases) which might help some people.
http://www.wrensoft.com/zoom/support/faq_cgi_iis.html

# re: How to run CGI applications on IIS7 9/27/2008 6:23 AM Allan
Thank you very much!

# re: How to run CGI applications on IIS7 2/5/2009 6:03 AM Harald Mais
We try to run our cgi-app under IIS 7.0 and Vista.
In your tutorial you explained what to do under
IIS 7.0 (Windows Server 2008).
We configured "ISAPI and CGI Restrictions" and "Handler Mappings" as explained, but we get an Error "502.2 Bad Gateway".
Under Vista we can't find the "Server Manager".
(perhaps we ar blind)
Is there no "Server Manager" or can you give as a hint what to do instead?
Thanks for an answer.

Thanks for an answer.

# re: How to run CGI applications on IIS7 3/19/2009 8:21 AM mofun.cc
Thank you!
I got the same problem.

# re: How to run CGI applications on IIS7 5/14/2009 3:52 AM Marco
Same here!

We have converted the directory where the .exe is into 'application'. We entered Module Mapping for this directory to the .exe-file, with executable rights. And we checked ISAPI and CGI restrictions.

Still when calling the html-page that launches the .exe:

"HTTP Error 502.2 - Bad Gateway
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "".

Anyone out there with suggestions?

# re: How to run CGI applications on IIS7 7/3/2009 5:22 AM the birdie
Hi,
Anyone know how to run all cgi's on a given folder without specifiying each file? It seems kinda of a pain in the butt to do this. Would I have to make a dll file that does this? any help? heh

thanks
-- the birdie

Post Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: