Solved

CGI configuration for NT and IIS

Posted on 1998-06-01
7
284 Views
Last Modified: 2013-12-25
Ok, I'm kind of new to CGI, and am having some trouble getting started, not because of any difficulty with the CGI programming itself, but because of my server.

I have a server running NT 4.0 Server SP 3 and IIS 3... Anyway, here is the problem, and what I've tried so far.
I created and compiled a very simple program in C. It does nothing more than display an html header and a single string. Just a simple test program basically.

I created a cgi-bin directory under the default wwwroot directory of the server, and granted Read/Execute permission to everyone. I then created a simple HTML file as follows:

begin file -------
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (WinNT; I) [Netscape]">
   <TITLE>My CGI Test Bed</TITLE>
</HEAD>
<BODY>

<H1>
My CGI Test Bed</H1>
<FORM METHOD="POST" ACTION="/cgi-bin/test.exe?test=0">Press&nbsp;<INPUT TYPE="submit" VALUE="Here">
to run the program.&nbsp;</FORM>
</BODY>
</HTML>
end file ----------

I placed this html file in the same directory as my personal web page, because I know that directory works...
When I access this file, it comes up fine, and displays the button as it should. However, when I press the button that SHOULD call the cgi program immediately, the server requests a username and password. Nothing works, I've even tried the Administrator password, it doesn't care. The permissions on the directory are set to RX for everyone and IIS has permissions set the same. If I move the cgi program to my personal directory, where the .html file is also stored, I have the same problem. It wants a login. Does anyone know what I need to change to get IIS to execute this program properly? Do I need to change the .exe extension to something else, or what?
0
Comment
Question by:wrussell051197
  • 3
  • 3
7 Comments
 
LVL 28

Expert Comment

by:sybe
Comment Utility
When you have created a cgi-bin directory, you should go into IIS, make it a virtual directory and make it executable, this makes IIS treat that directory as a cgi-bin directory, no matter what the name is.

Use the IIS manager to do this.

0
 

Author Comment

by:wrussell051197
Comment Utility
I have done this already. The virtual directory is named cgi, permissions are set as follows:

Access Permissions:
     Read
     Log Access
Content Control
     Index this Directory
Aplication Settings:
     Execute (including script)
     Starting Point: <Default Web Site>/cgi

it still doesn't work.
0
 
LVL 6

Accepted Solution

by:
alamo earned 100 total points
Comment Utility
One possible problem is that even though your program is simple, it still might require DLLs to run, and those DLLs can't be located in directories which require access permissions the server doesn't have (the sytem32 directory, for example). Try moving your support DLLs to the same directory as your executable.

This is the most common cause of such problems, though the fact your administrator password didn't at least allow you to run your program make me wonder if there isn't something else happening also. But definitely worth checking. Good luck!
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:wrussell051197
Comment Utility
What DLLs would be required to run a very simple program. The only statements in it are printfs. Here's the code:

begin file ----------------------
#include <stdio.h>

main(int argc, char **argv) {
  printf("Content-type: text/html\n\n");

  printf("<HTML><HEAD><TITLE>Hello!</TITLE></HEAD>\n");

  printf("<BODY><H1>Hello, World!</H></BODY></HTML>\n");
}
end file -----------------------

I mean, there's not much there to require a DLL...
0
 
LVL 6

Expert Comment

by:alamo
Comment Utility
I don't know what DLLs are needed, since I don't know which compiler you are using. But to find out, right click on your .exe in explorer or My Computer and choose "Quick View". The "import table" shows which DLLs are required. User32, Kernel32, gdi32 are all Windows system DLLs and aren't subject to the security, others which are listed would be.

By the way... this .exe needs to be 32-bit, 16-bit won't work.
0
 

Author Comment

by:wrussell051197
Comment Utility
By the way, this idiot had his compiler set to 16-bit DOS mode :) A quick change to 32-bit Win32 mode and everything worked great :)

Thanks again :)
0
 
LVL 6

Expert Comment

by:alamo
Comment Utility
Great, glad it's working for you! :)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn how to count occurrences of each item in an array.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now