Using PERL Scripts

OmniHTTPd supports the use of Perl for developing Standard CGI scripts. Perl has become a very popular scripting tool for extending web servers because it is extremely flexible and easy to learn. OmniHTTPd comes with an excellent Perl library to make CGI scripting even easier. Output from Perl scripts are treated the same as regular CGI scripts. This means that the script should read its input from the standard input stream and send its output to the standard output stream just like any other CGI script.

Installing a Standard Perl Interpretor

Step 1: Obtain and install a Perl interpreter
OmniHTTPd does not come bundled with a Perl interpreter. We recommend getting Perl for Win32 from ActiveState. If this is the first time you have installed Perl, installing it into the default directory (C:\Perl), will make things a little less confusing.

Step 2: Check the entry in the External script section
There should already be an entry in the External section of the Global Server Properties. The virtual section should be the extension, .pl and .cgi in this case, and the actual should be the full path of the Perl interpretor. If you do not use the .cgi extension, you can remove that entry.

Step 3: Enable external script processing
External script processing should be enabled by default. You can check this setting in the Advanced section of the Global Server Properties.

Step 4: Place your Perl scripts in a CGI-BIN directory
When using a standard Perl interpreter, you must place your scripts in a Standard CGI directory. By default, this is C:\HTTPD\CGI-BIN. Make sure that the script ends with a .pl or .cgi extension.

Using Perl for ISAPI from ActiveState

Step 1: Install ActiveState's Perl for Win32
In order to use Perl for ISAPI, you must first install the standard perl interpreter. You MUST use ActiveState's interpreter in order to use their ISAPI extension. Follow the instructions above and verify that the interpreter is working by trying some of the sample scripts.

Step 2: Install Perl for ISAPI
Install Perl for ISAPI into the same directory as the installation instructions recommend. Ignore the error message when it complains that "No Microsoft Internet Information Server Installed."

Step 3: Add/Change the Perl External Processing Entry
Go into the External tab and change the processor for .pl to the ISAPI module provided by ActiveState. For example, your association might look like, (Virtual: .pl; Actual: C:\Perl\Bin\PerlIIS.DLL)

Step 4: Make an ISAPI Alias
Go under the ISAPI Extension tab and make an alias. For example, (Virtual: /ISAPI; Actual: C:\HTTPd\ISAPI)

Step 5: Move your Perl scripts into the ISAPI path
In order for PerlIIS.DLL to active, you must place your scripts, ending in .pl (or whatever extension you configured) in an ISAPI path that you have created.

Note for SSI users: You cannot use SSI to process Perl scripts under the same extension (i.e. pl) if an ISAPI application (such as Perl for ISAPI) is being used to service the extension. You must use a different extension for these features to interoperate. For example, you can configure a new extension, such as .plisapi for ISAPI launched Perl scripts, saving the regular .pl extension for the Standard launch.


Copyright © 1997 Omnicron Technologies Corporation