Solved

CGI configuration for NT and IIS

Posted on 1998-06-01
7
292 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
ID: 1829162
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
ID: 1829163
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
ID: 1829164
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:wrussell051197
ID: 1829165
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
ID: 1829166
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
ID: 1829167
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
ID: 1829168
Great, glad it's working for you! :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

912 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

20 Experts available now in Live!

Get 1:1 Help Now