FP2000: Using Perl with Microsoft Personal Web Server on Windows 95/98
ID: Q231998
|
The information in this article applies to:
SUMMARYThe third-party products discussed here are manufactured by vendors
independent of Microsoft; we make no warranty, implied or otherwise,
regarding these products' performance or reliability.
The following article describes setting up Microsoft Personal Web Server to utilize the Windows version of Perl. This will allow you to run Perl scripts on the Microsoft Personal Web Server.
The third-party products discussed here are manufactured by vendors
independent of Microsoft; we make no warranty, implied or otherwise,
regarding these products' performance or reliability.
This article also includes a sample Perl script that can be used to test the Perl engine on your computer.
MORE INFORMATIONWARNING: Using Registry Editor incorrectly can cause serious problems that
may require you to reinstall your operating system. Microsoft cannot
guarantee that problems resulting from the incorrect use of Registry Editor
can be solved. Use Registry Editor at your own risk.
For information about how to edit the registry, view the "Changing Keys and
Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete
Information in the Registry" and "Edit Registry Data" Help topics in
Regedt32.exe. Note that you should back up the registry before you edit it.
If you are running Windows NT, you should also update your Emergency
Repair Disk (ERD).
How to configure the Microsoft Personal Web Server to use Perl
For security reasons, you do not want perl.exe to exist in any directory that can be browsed from other computers.
With a script mapping in the registry, you can place the Perl.exe outside
of the normal directory structure and avoid such security risks.
- On the Start menu, click Run.
- In the Open box, type "Regedit" without the quotation marks and click OK.
- Open the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC \Parameters\ScriptMap
- On the Edit menu, point to New, and click String Value.
- Name the value .pl and press Enter.
- Select .pl, and click Modify on the Edit menu.
- In the Value Data box, <the full path to perl.exe>\perl.exe %s %s
NOTE: The "%s %s" is case sensitive. (e.g. "%S %S" will not work).
- Close the Registry Editor, and restart your computer.
How to create Perl script to test with
Create a file with Notepad, and type the following lines of code. Save the
file as testing.pl in a folder in your web. Make sure this folder is marked executable.
In Notepad, type the following:
print "HTTP/1.0 200 OK\n";
print "Content-Type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>Perl Test Page</TITLE>\n";
print "</HEAD>\n";
print "<BODY>\n";
print "<H3>This is a test to see if Perl is Working</H3>\n";
print "<P>\n";
print "<H5>If you can see this, Perl is properly configured</H5>\n";
print "</BODY>\n";
print "</HTML>\n";
How to test the script
To test the script, simply browse to the Perl script in Internet Explorer. For example, if you placed the testing.pl file in a folder named cgi-bin in your root web, you would type the following in the Internet Explorer address bar:
http://localhost/cgi-bin/testing.pl
Additional query words:
Keywords : kbdta
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbinfo
|