http://qs321.pair.com?node_id=31145

sinan has asked for the wisdom of the Perl Monks concerning the following question:

I want to be able to use CGI offline from my Windows 95 machine, just as if I was running it from the Net. (Only a lot FASTER) What is the best perl Server for Windows 95 that contains the CGI.pm package?

Something easy to install, please.

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: How can I serve Perl CGI scripts on Win32?
by Ovid (Cardinal) on Sep 05, 2000 at 21:05 UTC
    You're talking about two different things. Perl is not CGI, nor is it a Web server. What you need is a Web server and Perl, two separate things.

    I would get my version of Perl for Windows from ActiveState and then get a copy of Apache for Windows. It's easy to install, but you need to read through the docs for configuration information. Configuration is simple, though, if all you want is CGI.

      You can serve perl CGI scripts with IIS, just like you would on a unixish system. On unixish systems you have a shebang that tells what program should execute the perl script:
      #!/usr/bin/perl
      In IIS on windows you use the extension of the perl script (e.g. ".pl", or whatever you choose) to decide what program should execute the perl script. In IIS you can decide this on a per directory basis. Here is a quote from the ActivePerl documentation for Perl 5.005_03 (HTML docs: ActivePerl FAQ->Web Server Config):
      ".... From the tree display on the left, select the level at which to apply the mappings. You can choose an entire server, web site, or a given virtual directory.

      Select Properties from the Action menu.

      If you chose to administer the properties for the entire server, the Server Properties dialog will appear. Select WWW Service from the Master Properties pull-down menu and click the Edit button under Master Properties. This opens WWW Service Master Properties. Select the Home Directory tab and proceed to step 7.

      If you chose to administer the properties for an entire web site, the Web Site Properties sheet appears. Select the Home Directory tab and proceed to step 7.

      If you chose to administer the properties for a virtual directory, the Virtual Directory Properties sheet appears. Select the Virtual Directory tab and proceed to step 7.

      Click the Configuration button. This opens the Application Configuration dialog.

      Select the App Mappings tab and click the Add button. You see the Add/Edit Application Extension Mapping dialog.

      To run Perl as a CGI application, type the full path to Perl.EXE followed by %s %s. When a script is executed, the first %s will be replaced by the full path to the script, and the second %s will be replaced by the script parameters. ..."

      /jeorgen

Re: How can I serve Perl CGI scripts on Win32?
by pjakobs (Initiate) on Mar 29, 2002 at 16:54 UTC
    If you already have a server with IIS installed and don't want to install Apache instead, you can also get ActiveState to work with IIS. As long as you install ActiveState perl after IIS has been installed, ActiveState will configure IIS for you automagically. Otherwise, you can configure it manually. Just follow the instructions here.
      I did everything above regarding the installation of IIS and then ActiveState's perl, but still my cgi's wouldn't work. The cardiff link was extremely helpful in that it showed me how to go in and add .cgi to the server mapping. Once that was done, presto-chango!, the scripts were running. Thanks, vroom, for providing that link.
Re: How can I serve Perl CGI scripts on Win32?
by erikharrison (Deacon) on Mar 29, 2002 at 17:30 UTC

    You need a Web Server. Apache and IIS are your best choices.

    You need a copy of the Perl distribution. Active State is your best bet.

    As for getting things to go FAST, you could use Active State's PerlEX or mod_perl for Apache. Look these up to see if they meet your needs.

Re: How can I serve Perl CGI scripts on Win32?
by simon.proctor (Vicar) on Mar 29, 2002 at 17:34 UTC
    If you are running windows 95 then you can forget IIS. On the win95 machine at work I have used Apache and PWS. I'd start with those (though Apache is the better of the two by miles).

    Install Activestate Perl and you will get the CGI module as standard. Then just follow the docs to get it to work with PWS (if thats what you go for) or look at ScriptAlias and AddHandler for Apache.

    HTH :)
Re: How can I serve Perl CGI scripts on Win32?
by chromatic (Archbishop) on Sep 07, 2000 at 07:14 UTC
    Jellybean is a small Perl object server that speaks HTTP, serves simple files, and has CGI support. It runs on Windows, and could use some testers there.

    It's written completely in Perl, and is very easy to setup. (and, yes, I and jlp work on it).