Solved

access cgi-bin file in windows 2000

Posted on 2002-04-12
7
229 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
Comment Utility
# probably you're missing following in httpd.conf
AddHandler cgi-script .pl
0
 
LVL 5

Assisted Solution

by:harwantgrewal
harwantgrewal earned 33 total points
Comment Utility
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
Comment Utility
The scriptalias way works in Unix system, but does it work in windows?  
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 5

Expert Comment

by:harwantgrewal
Comment Utility
ya it works in windows also

Harry
0
 
LVL 15

Assisted Solution

by:samri
samri earned 33 total points
Comment Utility
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
Comment Utility
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

743 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

8 Experts available now in Live!

Get 1:1 Help Now