Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Learning CGI

by ryddler (Monk)
on Jan 05, 2001 at 03:39 UTC ( [id://49906]=note: print w/replies, xml ) Need Help??


in reply to Learning CGI

Personal Web Server (PWS) is also available for use on Win9x and NT. It is a version of Internet Information Server 4.0 (IIS) and you should be able to find it on your Win98 installation cd.

Once you have PWS installed on your machine, you need to either modify the registry key:

WARNING! DO NOT EDIT THE REGISTRY IF YOU DO NOT UNDERSTAND WHAT YOU ARE DOING!!!

"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\Parameters\Script Map"

to add a new string value(s) with the name(s):

.pl and/or .cgi

with the value:

c:\perl\bin\perl.exe -T %s %s

Or...

D/L the snippet below, save it with the extension .reg, and merge it into your registry by double-clicking it. If the "open with" dialog pops up choose "regedit" as the program to "open with"

REGEDIT4 [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\Parameters +\Script Map] ".cgi"="c:\\perl\\bin\\perl.exe -T %s %s" ".pl"="c:\\perl\\bin\\perl.exe -T %s %s"
Update: Added "-T" to the above snippets as Ovid mentioned below. (Now I better go investigate Taint ;)

ryddler

Replies are listed 'Best First'.
(Ovid - security problem in your solution) Re(2): Learning CGI
by Ovid (Cardinal) on Jan 05, 2001 at 03:59 UTC
    Your solution is fine, but the problem is, CGI scripts should be run with Taint mode enabled. Unfortunately, you have to pass the -T switch to the perl executable when it's started. You can't use it afterwards or else you'll get a "Too late for -T switch" error and the script will die. To solve that, the value should be set to:
    c:\perl\bin\perl.exe -T %s %s
    Or the appropriate lines in the snippet should read
    ".cgi"="c:\\perl\\bin\\perl.exe -T %s %s" ".pl"="c:\\perl\\bin\\perl.exe -T %s %s"
    If anyone knows how to enable Taint mode after the perl executable has already been started, please speak up! I would be very happy to know that I am wrong.

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://49906]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-23 16:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found