Solved

access cgi-bin file in windows 2000

Posted on 2002-04-12
7
244 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
[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
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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

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

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secureā€¦
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 learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

752 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