Solved

access cgi-bin file in windows 2000

Posted on 2002-04-12
7
232 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
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

910 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

21 Experts available now in Live!

Get 1:1 Help Now