[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

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

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
rockies1
Asked:
rockies1
  • 4
  • 2
1 Solution
 
maneshrCommented:
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
 
rockies1Author Commented:
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
 
rockies1Author Commented:
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.

 
rockies1Author Commented:
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
 
rockies1Author Commented:
Thank you, Thank you, THANK YOU!!!!!
0
 
maneshrCommented:
most welcome :-))

Glad to know your system is working fine!!!

Happy CGI-ing!!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now