Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

I need to be able to run CGI/Perl, but don't know how...

Posted on 2000-05-09
6
Medium Priority
?
277 Views
Last Modified: 2013-12-25
I am currently hosting my web page on my own PC using Microsoft's Personal Web Server on a Win98 machine.

I would like to be able to run CGI scripts on the web-site, but am totally new to them.  I haven't a clue on how to do it.

Can someone give me detailed descriptions on what needs to be done?

Thanks!!

If you proved great detailed instructions THAT WORK, I'm more than happy to share more points than are advertised...
0
Comment
Question by:rockies1
[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
  • 4
  • 2
6 Comments
 
LVL 16

Accepted Solution

by:
maneshr earned 800 total points
ID: 2793747
you can use PERL as a scripting language to run your CGI program.

Best of all PERL is available for free. you can download PERL for Windows 95/NT from http://www.ActiveState.com/pw32/.

here is the step-by-step process on configure perl on PWS.

Setting up M.S. PWS to run Perl

Prerequisites:

  The Microsoft Personal Web Server (MS PWS) must be installed on the system.

Steps:

1.Download Perl for Windows 95/NT
2.Create a Perl5 folder on your hard drive and extract the contents of the self-extracting
   .exe to that directory; remember to preserve the folder names and file names.

   Your directory layout should look like the following after the extract:

   \Perl5\bin
   \Perl5\docs
   \Perl5\eg
   \Perl5\lib

3.Run the perlw32-install.bat batch file from the \Perl5\bin directory.
4.Make sure that the installation updated your path in your c:\autoexec.bat file to include
   x:\Perl5\bin (where x: is the drive letter you installed Perl).

The above steps will install Perl 5 on your Windows 95/NT PC.  The steps below will configure
the Microsoft Personal Web Server to run Perl5.

1.Click on Start, Run, regedit.exe
2.Expand HKEY_LOCAL_MACHINE
3.Expand System
4.Expand CurrentControlSet
5.Expand Services
6.Expand W3Svc
7.Expand Parameters
8.Expand Script Map
9.Right click within the right pane/frame (of Script Map) and select New, string value.
10.Enter .pl
11.Modify .pl and enter the full path to the perl.exe program along with "%s %s"

   example:  e:\Perl5\bin\perl.exe %s %s

11.Create additional entries for ".cgi" and ".plx"
12.Exit Regedit.
13.If MS PWS is running then, then start and stop http services.


The steps below will set up a cgi-bin or cgi-local (your choice) folder for use to contain your Perl
scripts:

  1.Start FrontPage Explorer, and change to Folder View.
  2.If you don't currently have a cgi-bin or cgi-local folder, create a new folder and name it
     cgi-bin or cgi-local within FrontPage Explorer.
  3.Within FrontPage Explorer, right click on the cgi-bin (or cgi-local) folder and select
     properties.
  4.Check the box to allow scripts and folders to be run.

Do the following to test your set up:

  1.Using notepad (or any text editor), enter the Perl script below, save it to your cgi-bin (or
     cgi-local) directory and name it "env.cgi"

     #!/usr/bin/perl
     print "content-type: text/html\n\n";
     print "<HTML><BODY><PRE>";
     print "<ul>";
     foreach (sort keys %ENV)
     {
          print "<li> Env Var key: $_ value $ENV{$_}";
     }
     print "</ul>";
     print "<br>";
     print "</PRE></BODY></HTML>";
     exit 0;

  2.Now browse http://YOURLOCALHOST/cgi-bin/env.cgi 

Remember to substitute the name of your local PWS/host above.  Also replace "cgi-bin" with
"cgi-local" if you are using a "cgi-local" directory.

The above script should display all of the environment variables the server (PWS) can see.

PROBLEM SOLVING

If you do the above and it does not work, then check the following:

     MIME types are set up for .cgi and .pl (to check / remove MIME types, start Windows
     Explorer, click on view, options, file types).
     Folder where you placed the CGI script is not marked execute (run).
     Registry settings are not correct.
     You are using the FrontPage Personal Web Server instead of the Microsoft Personal
     Web Server.
     You are browsing the .cgi or .pl as a file instead of a web address such as
     http://default/cgi-bin/env.cgi
     The script you are using has syntax errors, logic errors, or does not output proper HTML.

=================================

Hope that helps.
0
 

Author Comment

by:rockies1
ID: 2794780
OK, I did what you've described, but no luck. There were a few deviations form what you described.

1. The D/L from activestate.com installed Perl, so I didn't have a perl32-install.bat file

2. You mentioned Front Page explorer...I don't have it, don't know what it is.  I tried doing what you described in Personal Web Server, and my choices for a folder are: Read, Execute, and Scripts.  I tried with ALL checked, and then with all but READ, and no luck.

3.When I try to access the env.cgi, I get an HTTP 500 error...

4. There is no file association in Explorer for .cgi files...Should there be?

Am I missing something?

Thanks!!

0
 

Author Comment

by:rockies1
ID: 2795385
Adjusted points from 100 to 200
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:rockies1
ID: 2795386
I figured out my problem...

On my PC, the directory I was using for my web page was: c:\Web Page\
It didn't like the space....Changing it to c:\WebPage made it work.

The points are ALL YOURS, and I appreciate the large amount of effort you went to...Especially the detail...
0
 

Author Comment

by:rockies1
ID: 2795388
Thank you, Thank you, THANK YOU!!!!!
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2797385
most welcome :-))

Glad to know your system is working fine!!!

Happy CGI-ing!!!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
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 the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

618 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