Solved

access cgi-bin file in windows 2000

Posted on 2002-04-12
7
241 Views
Last Modified: 2013-11-18
I installed apache  server in windows 2000.  I can access html files through locahost.  but when I try to execute perl files in the cgi-bin folder, it will be downloaded rather than to be executed.  Those files can be executed in prompt comand window.  Anyone know how to do the configuration to enable me to access those files remotely?  Thanks!
0
Comment
Question by:fallcool
7 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 34 total points
ID: 6939053
# probably you're missing following in httpd.conf
AddHandler cgi-script .pl
0
 
LVL 5

Assisted Solution

by:harwantgrewal
harwantgrewal earned 33 total points
ID: 6939090
check for the permission of the folder and the directive if you find this direcive then there is no need to specify the AddHandler

ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"


# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi


Harry
0
 

Author Comment

by:fallcool
ID: 6939172
The scriptalias way works in Unix system, but does it work in windows?  
0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
LVL 5

Expert Comment

by:harwantgrewal
ID: 6939751
ya it works in windows also

Harry
0
 
LVL 15

Assisted Solution

by:samri
samri earned 33 total points
ID: 6940976
fallcool,

Does you CGI (perl program) produce the right HTTP Header.

In most cases, all program/code that resides in the directory specified by ScriptAlias will be executed by the Apache as CGI program.  It all depends to the code itself to generated proper header/trailed that conform to CGI spec, which in most cases, would be printing;

  print "Content-type: text/html\n\n";
  print "<HTML>\n";
  print "<HEAD>\n";
  print "</HEAD>";
...blah blah
  print "</HTML>";

would do the job.

If the server config is OK (as commented earlier by harwantgrewal), it's good to check the code.  Try to run the code in command prompt (console window), and make sure that the at least, some like the example I gave, should be display.  Otherwise, the your will get a weird result is you try to open in browser window.

I do recall (from somewhere) that the #!c:\bin\perl.exe, sometime makes some difference.  Check you perl code, try to adjust it to "#! c:\perl\bin\perl.exe", or #!c:\perl\bin\perl.exe .  It is not a definite solution, but it's worth a try.

good luck.


NOTE: This is an ELABORATION to ahoffman's.
If you plan to run the scripts outside of you ScriptAlias, make sure the your defined Option ExecCGI, in the respective <Directory> tag, and then enable the AddHandler cgi-script <.extension>

You can have multiple file extension defined per AddHandler line, or you can have multiple AddHandler for each file type.  It all depends on you preference.

AND.  Have you checked the apache's error log.  In most cases, the should be something logged.

good luck.
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 9682013
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area with the following recommendation for this question:

Split between harwantgrewal, samri, and ahoffmann

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

periwinkle
EE Cleanup Volunteer
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

820 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