Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

access cgi-bin file in windows 2000

Posted on 2002-04-12
7
Medium Priority
?
267 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
6 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 136 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 132 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
LVL 5

Expert Comment

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

Harry
0
 
LVL 15

Assisted Solution

by:samri
samri earned 132 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
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

824 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