?
Solved

CGI configuration for NT and IIS

Posted on 1998-06-01
7
Medium Priority
?
310 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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 …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

800 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