Solved

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

Posted on 2000-05-09
6
257 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
  • 4
  • 2
6 Comments
 
LVL 16

Accepted Solution

by:
maneshr earned 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Adjusted points from 100 to 200
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

 

Author Comment

by:rockies1
Comment Utility
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
Comment Utility
Thank you, Thank you, THANK YOU!!!!!
0
 
LVL 16

Expert Comment

by:maneshr
Comment Utility
most welcome :-))

Glad to know your system is working fine!!!

Happy CGI-ing!!!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

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

15 Experts available now in Live!

Get 1:1 Help Now